Skip to content

Add all properties #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Add all properties #15

wants to merge 2 commits into from

Conversation

Explosion-Scratch
Copy link
Contributor

No description provided.

@msarca
Copy link
Member

msarca commented Sep 13, 2021

There is a reason we didn't do this so far: constructable stylesheets are supported only in Chromium-based browsers. That's approximately 80% of the web, which is good. But for Safari and FF, we need to pre-generate a set of CSS rules for each assembler property. To avoid FOUC and other issues with layout, we generate 10 rules for each property. This PR increases the number of pre-generated rules, for FF and Safari, from ~1500 to ~4000. That's a huge leap! We need to make more performance tests and measure the impact.

@msarca msarca added the on-hold label Sep 13, 2021
@Awilum
Copy link
Contributor

Awilum commented Sep 13, 2021

@msarca I didn't get this...

We can't have all css properties in the asmcss core by default ?

@msarca
Copy link
Member

msarca commented Sep 13, 2021

We can't have all css properties in the asmcss core by default ?

No, we definitely can, but I don't know if we should. At least not without performance tests. IMHO the best place to complain about this is Firefox and Safari . They are the ones refusing to step into the 21st century, not us.

@Explosion-Scratch
Copy link
Contributor Author

We can't have all css properties in the asmcss core by default ?

No, we definitely can, but I don't know if we should. At least not without performance tests. IMHO the best place to complain about this is Firefox and Safari . They are the ones refusing to step into the 21st century, not us.

What if we keep it how it is, but provide an alternate system for css properties that aren't already accounted for by asmcss, and just compile anything, this could possibly mean the removal of the properties list altogether, right (except for prefixing)? E.g. sadkjaskldja.hover: blue would compile to el:hover { sadkjaskldja: blue }, even if the sadkjaskldja property is nonexistent and not supported by any browser.

@Awilum
Copy link
Contributor

Awilum commented Sep 13, 2021

It is not good that ASMCSS does not support all CSS properties by default. How we should know, what properties should be provided by default, and what properties should provide via plugins or via any other ways?

When I started work with a framework, I was supposed to have the ability to work with all CSS properties and not with some random CSS properties list.

Example:

this is works:

<div style="writing-mode: vertical-lr;">
  <div>
    Lorem ipsum dolor, sit amet consectetur adipisicing elit.
  </div>
  <div>
    Lorem ipsum dolor, sit amet consectetur adipisicing elit.
  </div>
</div>

but this is not:

<div x-style="writing-mode: vertical-lr;">
  <div>
    Lorem ipsum dolor, sit amet consectetur adipisicing elit.
  </div>
  <div>
    Lorem ipsum dolor, sit amet consectetur adipisicing elit.
  </div>
</div>

I hope ASMCSS x-style will able to support all CSS properties as native style do.

@Explosion-Scratch
Copy link
Contributor Author

I hope ASMCSS x-style will able to support all CSS properties as native style do.

When I started learning ASMCSS I was under the impression that it did, is the library simply striving to get to this?

The implications of this simple fact are mind-blowing: if you have ever used the style attribute, you already know how to use Assembler CSS.

Either way, that's a bit misleading, it would be cool if assembler did support every property, and wouldn't that make the code shorter?

@msarca
Copy link
Member

msarca commented Sep 18, 2021

https://asmcss.com/docs/1.x/assembler-properties.html#register-new-properties

Until Safari and Firefox evolve, this is the only viable solution.

@msarca msarca closed this Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants