-
Notifications
You must be signed in to change notification settings - Fork 22
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
Implement some features missing for literal syntax #43
Conversation
Benchmark Results:
Baseline (master):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A big change in the end but a worthy one. I especially like the reworked error reporting in the inline macro as a nice bonus. Having a single RuleBlockContent
is easy to read, but I am struggling a bit to understand the logic of when the output opens/closes output blocks. As long as nested qualified rules are not implemented, the combinatorial explosion from scss is avoided, so that's okay with me and it's not too far up on my agenda.
I think the design of @keyframes
could be its own PR, cause its usage is quite a bit different from styles, e.g. we'd want to generate the animation name, those have to be unique for the document.
This PR only contains changes of reimplementing |
max-width: 500px; | ||
} | ||
} | ||
@supports (max-width: 500px) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's possible to deduplicate this @supports
rule without having to implement a logic that also considers the next adjacent block / rule.
I am fine to overlook this bit without introducing more complicated logic into the StyleContext
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine by me aswell. At the end of the day, the output should resemble the input for easier debugging, but really only needs be correctly understood by the browser.
# Conflicts: # packages/stylist-core/src/ast/rule_content.rs # packages/stylist-macros/src/inline/parse/attribute.rs # packages/stylist-macros/src/literal/to_output_with_args.rs # packages/stylist-macros/src/output/block.rs # packages/stylist-macros/src/output/context.rs # packages/stylist-macros/src/output/maybe_static.rs # packages/stylist-macros/src/output/mod.rs # packages/stylist-macros/src/output/rule.rs # packages/stylist-macros/src/output/rule_content.rs # packages/stylist-macros/src/output/selector.rs # packages/stylist-macros/src/output/sheet.rs # packages/stylist-macros/src/output/str_frag.rs # packages/stylist-macros/src/output/style_attr.rs # packages/stylist/tests/macro_integrations/complicated-attributes-pass.rs # packages/stylist/tests/macro_integrations/nested_at_rule-pass.rs
Closes #31.
I think it's more reasonable to wrap up the current work in favour of #40 which will deprecate most of work here.
This PR consists of the following changes (inline):
@keyframes
are supported properlyat-rules
are denied@supports
and@rules
can now be nested inside of blocksStyleContext
so styles can be printed with indentation