-
-
Notifications
You must be signed in to change notification settings - Fork 75
fix cascade layers in combination with nesting and name defining at rules #739
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
Merged
romainmenke
merged 14 commits into
postcss-preset-env--v8
from
fix-cascade-layers--compassionate-little-penguin-005b45797a
Dec 13, 2022
Merged
fix cascade layers in combination with nesting and name defining at rules #739
romainmenke
merged 14 commits into
postcss-preset-env--v8
from
fix-cascade-layers--compassionate-little-penguin-005b45797a
Dec 13, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…-cascade-layers--compassionate-little-penguin-005b45797a
…sionate-little-penguin-005b45797a
…-cascade-layers--compassionate-little-penguin-005b45797a
…-cascade-layers--compassionate-little-penguin-005b45797a
…-cascade-layers--compassionate-little-penguin-005b45797a
…sionate-little-penguin-005b45797a
Antonio-Laguna
approved these changes
Dec 13, 2022
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.
This LGTM!
Thanks for adding this!
romainmenke
added a commit
that referenced
this pull request
Jan 24, 2023
* prefers color scheme (#436) * prefers-color-scheme : cleanup * cleanup * fix * more fixes * Update plugins/css-prefers-color-scheme/CHANGELOG.md Co-authored-by: Antonio Laguna <[email protected]> * peer dependency * import * update change log Co-authored-by: Antonio Laguna <[email protected]> * update tests (#485) * css-has-pseudo (#473) * css-has-pseudo * preset-env * update tests * fixes * docs * docs * changelog * fix * fix * fix * fix * css-has-pseudo : make the experimental plugin a noop (#500) * CSS Blank Pseudo (#486) * WIP * Tests and docs * Rewriting browser * Browser tests running * Touch to docs * Finishing * Minor updates * Moving the file to be `.mjs * Linted now * css-blank-pseudo : code review (#501) Co-authored-by: Romain Menke <[email protected]> * Updating package-lock * Updating lock again * Updating CHANGELOG * Updating Focus Visible (#513) * Updating Focus Visible * Returning CHANGELOG * Updating tests * focus-visible : code review (#514) * Updating CHANGELOG * focus-visible : code review (#514) Co-authored-by: Romain Menke <[email protected]> * case insensitive matching (#517) * Updating Focus Within (#516) * Starting focus-within plugin * Finishing focus within * Updating tests * Fixed tests after swapping preserve * Adding CHANGELOG * Updating tests * Generating docs * Better options for older browsers * postcss-blank : browser compat (#519) * postcss-blank : browser compat * fix * fix * postcss-focus-within : browser compat (#520) * postcss-focus-within : browser compat * lint * Adding global class to CSS Blank (#524) * Better handling for classList * Refactoring to reuse code * Appending `js-blank-pseudo` on load * Only apply if not applied before to avoid double classes * Updating docs * Class should happen always * Ensuring ready class is handled via plugin * Updating tests * Updating docs * Handling preset-env tests for blank pseudo * Conflicting test * fmt * css has pseudo : pseudo element support and .js-has-pseudo class (#525) * css has pseudo : pseudo element support and .js-has-pseudo class * update tests * fix * fix * css-has-pseudo: only test polyfill, we dont need to always test browser behavior * flip enableClientSidePolyfills (#528) * CSS Has Pseudo Experimental 0.6.0 (deprecated) * CSS Blank Pseudo 4.0.0 * CSS Has Pseudo 4.0.0 * Prefers Color Scheme 7.0.0 * PostCSS Focus Visible 7.0.0 * PostCSS Focus Within 6.0.0 * PostCSS Preset Env 8 Alpha 0 * update cli * add : disablePolyfillReadyClass (#558) * add : disablePolyfillReadyClass * Apply suggestions from code review Co-authored-by: Antonio Laguna <[email protected]> Co-authored-by: Antonio Laguna <[email protected]> * Extra space removal * CSS Blank Pseudo 4.1.0 * PostCSS Focus Visible 7.1.0 * PostCSS Focus Within 6.1.0 * browser polyfills : use window or self for the global polyfill (#586) * CSS Blank Pseudo 4.1.1 * CSS Has Pseudo 4.0.1 * Prefers Color Scheme 7.0.1 * PostCSS Focus Within 6.1.1 * bump postcss, node and npm versions (#599) * add install instructions for es modules * fix ci * fix ci * add support for postcss-html (#602) * refactor `postcss-custom-properties` and cleanup in `postcss-preset-env` (#603) * postcss-custom-properties * cleanup more tests * cleanup * docs and changelog * cleanup * more cleanup * docs * Update plugins/postcss-custom-properties/docs/README.md Co-authored-by: Antonio Laguna <[email protected]> * docs Co-authored-by: Antonio Laguna <[email protected]> * cleanup * cleanup * update gitignore for html document tests * refactor `postcss-custom-selectors` (#609) * postcss-custom-selectors * add support for scope and container * update TS targets * update lock file * lint * bring in changes from main * postcss-custom-media & css-tokenizer & media query parser (#627) * init * init * consume a token * consume a comment * add reader * tweaks * postcss interop * wip * consume number * fix * fixes * more tests * basic tokenizer * fixes and docs * some more bits * some more bits * getting somewhere * string tokens * almost there * should be complete, text coverage up next * add context * fix * add parser error reporting * fixes and more tests * more tests * fixes * more tests * still more tests * still more tests * fix && more tests * more tests * more tests * docs * wip * postcss-custom-media * wip * fixes * fixes * fixes * cleanup whitespace * bring back old tests * more tests and fixes * update lock file * remove todo comment * fix 'or' conditions * correctly prefix with not * better code structure * fix negation for older browsers * cleanup * update test files * merge * media query list parser (#659) * wip * wip * wip * wip * wip * finish range * more work * lint * fix ranges * more work * media lists * finish parser * toJSON * add a test suite * more tests * wip * lint * more tests * wip * fix range parsing * docs * add ancestry utility * fixes * fixes * allow parsing from tokens * add some convenience methods * fixes * more migration * more convenience methods * more type predicates * wip * fix * fix * finish up * lets get rid of those build errors * fixes * fixes * increase test coverage * fix + more test coverage * getter -> method * fix build + more test coverage * export and more test coverage * cleanup * cleanup * cascade-layers : execution order * update layer examples * update docs * wording * postcss-custom-media : update docs (#692) * psotcss-custom-media : improve docs * wording * wording * update rollup (#694) * update rollup * fix windows support * postcss-preset-env v8 : tweaks before next alpha (#695) * postcss-preset-env v8 : tweaks before next alpha * fix * typo * fix * wrap calls to selector parser in try/catch (#698) * wrap calls to selector parser in try/catch * Update plugins/css-blank-pseudo/src/index.ts * add tokenizer benchmarks and make it ±20% faster * remove spread operator * tune terser to have better runtime performance * more terser config * more specific terser config * better benchmarks * postcss-media-queries-aspect-ratio-number-values (#699) * merge * PostCSS Media Queries Aspect-Ratio Number Values 1.0.0 * CSS Tokenizer 1.0.0 * CSS Parser Algorithms 1.0.0 * Media Query List Parser 1.0.0 * PostCSS Custom Selectors 7.0.0 * PostCSS Custom Properties 13.0.0 * PostCSS Custom Media 9.0.0 * PostCSS Cascade Layers 2.0.0 * PostCSS Preset Env 8 Alpha 1 * add postcss-parser-tests for css-tokenizer * switch to .mjs * add tslib as an explicit dependency * few more tests * postcss-custom-media: avoid complex generated CSS in more cases (#709) * postcss-custom-media: avoid complex generated CSS in more cases * undo * fmt * more install instructions * PostCSS Custom Media 9.0.1 * Improving Browser Polyfills docs for Next.js (#716) * Creating sample doc * Adding docs for all packages * shorter label name, max is 50 chars * design-tokens : add support for at rules (#717) * design-tokens : add support for at rules * lint * more error handling * optimize * Update plugins/postcss-design-tokens/src/transform.ts * document how parallel builders can affect plugins (#724) * document how parallel builders can affect plugins * make it clear that postcss-import is not the only solution * Removing warning on V8 So it goes out once it’s merged * final typescript conversions (#712) * final typescript conversions * postcss-dir-pseudo-class * export plugin types * fix * fix * fix * postcss-gap-properties * lint * postcss-overflow-shorthand * postcss-place * fix * postcss-pseudo-class-any-link * one more * more fixes and typings * wip * docs * typed options for postcss-preset-env * final fixes * add to list of plugins in execution order * clean up * Update index.ts * update cssdb * update CHANGELOG * changelog * improve clean commands and reduce impact of changes on the cli package * lint * update has pseudo dependencies * has pseudo : fix cleanup of rules in browsers with native support (#751) * has pseudo : fix cleanup of rules in browsers with native support * changelog * fix cascade layers in combination with nesting and name defining at rules (#739) * fix cascade layers * fix * merge * custom properties * postcss-custom-selectors * document issue * fix * cleanup * build * update dependencies * improve logging of enabled features * more tests * cascade-layer-name-parser (#755) * cascade-layer-name-parser * fixes * integrate * fixes and integrate further * one more test * better error handling * cleanup * rebuild * update dependencies * update dependencies * css-tokenizer and parser-algorithms : fixes and performance improvements (#760) * css-parser-algorithms : fix unclosed blocks and functions * add more tests * one more test * performance improvements * improve performance * wip * wip * more performance improvements * finish up * improve benchmarks * little bit faster * fixes and some convenience methods * more improvements * more tests and fixes * fix * better error type * custom media parsing * fmt * fix * add normalization for Simple Block and Function * more tests * add css-tokenizer-tests for increased test coverage * more tests * update readme's * css-tokenizer : remove `commentsAreTokens` (#779) * remove dead code * postcss-logical-viewport-units (#780) * postcss-logical-viewport-units * finish up * match other logical plugins * add test with a negative number in a range * code quality * one more fix * simplify consume number * simplify further * one more fix * CSS Tokenizer 2.0.0 * CSS Parser Algorithms 2.0.0 * Media Query List Parser 2.0.0 * Cascade Layer Name Parser 1.0.0 * Update lock * Selector Specificity 2.1.0 * post release patches (#793) * rebuild * remove outdated and obsolote docs * remove deno support from postcss-nesting (#795) * text-decoration : fix shorthand in Safari with single node values (#794) * text-decoration : fix shorthand in Safari with single node values * update changelog * update cssdb * PostCSS Logical revamp (#740) * Getting started * wip: starting with single logical on margin * Updating how the transform works * Getting block/inline working for padding and margin * Completing margin and padding * Enable caption-side, float and clear * adding support for text-align * further progress Resize Block size and Inline Size Offsets * Completing border * Addiing docs * Rewriting test * Missing part of the CHANGELOG * Removing no longer needed check * Updating tests * Updating more tests * Linting package.json * feature/logical-revamp-v8 : feedback (#773) * feature/logical-revamp-v8 : feedback * Update plugins/postcss-logical/src/utils/parse-value-couple.ts Co-authored-by: Antonio Laguna <[email protected]> * undo * more undo Co-authored-by: Antonio Laguna <[email protected]> * Adding missing docs * Removing `preserve` * Updating CHANGELOG * add a few abstract tests with various configs (#775) * logical : border radius (#776) * logical : border radius * fix * typescript... * Logical Float and Clear (#781) * Removing float and clear from logical plugin * Adding CHANGELOG * Introducing postcss-logical-float-and-clear * Preparing labeler and exteernals * Update plugins/postcss-logical-float-and-clear/docs/README.md Co-authored-by: Romain Menke <[email protected]> * Update plugins/postcss-logical/docs/README.md Co-authored-by: Romain Menke <[email protected]> * Update .github/labeler.yml Co-authored-by: Romain Menke <[email protected]> * Adding to Issue Templates Co-authored-by: Romain Menke <[email protected]> * logical-resize (#792) * logical-resize * rebuild * Updating CHANGELOG * Updating dependencies * Wire logical into Preset Env and CLI (#798) * remove extra space * remove plugin-options for logical * include new logical plugins * minor format * removing redundant if within shared-options * adding shared logical options to preset-env options * ensuring logical options get passed * updating tests * adding tests for logical options * removing wrong object * adding test for logical * adding clear and resize to the CHANGELOG * updating tests and built files * Updating CSSDB * Generating FEATURES * update CHANGELOG and README * Updating tests for ratios * Adding missing example * Updating CLI * rebuild * a few tweaks and some more tests Co-authored-by: Romain Menke <[email protected]> Co-authored-by: Romain Menke <[email protected]> Co-authored-by: Romain Menke <[email protected]> Co-authored-by: Romain Menke <[email protected]> * housekeeping * last tweaks Co-authored-by: Antonio Laguna <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
postcss-preset-env
cascade-layers
custom-media
custom-selectors
custom-properties
see : #481 (comment)
By running
cascade-layers
before any other plugin we forced that plugin to support everything. This included things like nested css and all future css.The
cascade-layers
plugin needed to understand the most modern syntax.This pull request rolls back the recent changes and implements :
cascade-layers
is always lastWe shift the burden from the
cascade-layers
plugin to a select number of other plugins.Those plugins do not need to be capable of the entire Cascade Layers feature. Only just enough to know which declaration has priority if there are naming conflicts.
This issue did made me realize that Cascade Layers will complicate future plugins.
We have to assume that anything can be layered and that both layers and source order needs to considered.
Plugins that only provide fallbacks for declarations or selectors aren't affected.
But anything that interacts with the structure will need to take Cascade Layers into account.