This repository has been archived by the owner on Dec 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Check that we are exporting valid CSS #1566
Merged
Merged
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
🦋 Changeset detectedLatest commit: f469890 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
ob6160
force-pushed
the
ob/lightningcss-assertions
branch
from
October 3, 2022 17:27
a71c116
to
0596633
Compare
…get syntax highlighting for our CSS block definitions
…BeValidCSS which wraps the lightningcss to simplify our test cases and make them easier to read
… as a separate pr
…d not come from lightningcss - otherwise return the jest matcher response
…acts on our code and is not part of it
Co-authored-by: Alex Sanders <alex@sndrs.dev>
ob6160
force-pushed
the
ob/lightningcss-assertions
branch
from
October 3, 2022 17:28
0596633
to
f469890
Compare
joecowton1
approved these changes
Oct 4, 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.
Much clearer! Thanks for breaking it out.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What is the purpose of this change?
In some cases, Emotion style CSS is exported from
source-foundations
. Applications that consume these exported styles can have an expectation that only CSS is provided, but right now we make no guarantee that this is the case.This breaks the build in projects like dotcom rendering (AMP specifically), because these invalid CSS rules are being rendered directly onto the page, without going through the Emotion stack.
This change fixes some invalid CSS comments that use
//
vs/* .. */
in our reset which could affect the cascade. We also add unit tests using thelightningcss
project to parse our exported CSS so we have confidence that we are shipping valid code.What does this change?
.toBeValidCSS()
so we can make assertions in a natural way against the CSS that we export using thelightningcss
library.This PR was split out from #1554 so we could make it distinct from other changes to export emotion styles from the typography module.