-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: support from global for composes #669
Conversation
This is nice feature in css-modules, for doing quick composition of global classes. `global` acts as a keyword instead of a file here
Travis tests have failedHey @jquense, Node.js: 8npm test -- --ci
TravisBuddy Request Identifier: a4d34cf0-d65b-11e9-82ee-13bec588d4b8 |
Codecov Report
@@ Coverage Diff @@
## master #669 +/- ##
=======================================
Coverage 99.12% 99.12%
=======================================
Files 45 45
Lines 1139 1139
Branches 174 174
=======================================
Hits 1129 1129
Misses 10 10 Continue to review full report at Codecov.
|
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.
Looks great, and I'm very pleased at how straightforward the changes were 😅
You've got the checkboxes all set up correctly marking that this still needs docs, which should just be a a new example and some small updates to packages/www/src/guide/feature-composing-styles.md
@@ -22,10 +22,10 @@ describe("/processor.js", () => { | |||
".a { composes: b from nowhere.css; }" | |||
); | |||
} catch({ message }) { | |||
expect(message).toMatch(`SyntaxError: Expected source but "n" found.`); | |||
expect(message).toMatch(`SyntaxError: Expected global or source but "n" found.`); |
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.
Ugh, I wish it was easier in pegjs to customize the error messages. Nothing you need to change here, just annoyed and sharing.
I was really impressed with how easy this was to do. I initially saw the generated parsers and thought it was a bit overkill, but i'm convinced now, gonna steal this strategy for other stuff! |
local : "dafdfcc_other aeacf0c_single" | ||
composable : "dafdfcc_composable", | ||
local : "dafdfcc_composable aeacf0c_local", | ||
removed : "dafdfcc_composable aeacf0c_local aeacf0c_removed" |
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 updated this to match the output of the example file above
Hey @jquense, TravisCI finished with status TravisBuddy Request Identifier: 249a90a0-d80b-11e9-b22f-8dc32e2a8e5f |
Hey @jquense, TravisCI finished with status TravisBuddy Request Identifier: 728d8c30-d816-11e9-94f2-eb1f1b783936 |
This is nice feature in css-modules, for doing quick composition of global classes.
global
acts as a keyword instead of a file hereDescription
Parses
composes: a, b, c from global
ascomposes: global(a), global(b), global(c)
Motivation and Context
Css-modules supports this, and it is nicer syntax when working with lots of global classes, such with bootstrap utility classes
How Has This Been Tested?
added a test. I could get the current tests to pass locally tho, perhaps i'm setting the repo up wrong? did
lerna bootstrap
in the root, assuming that was enough.Types of changes
Checklist: