You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The comment appearing thrice was because /*! Checka11y.css v1.3.3 | MIT License | github.com/jackdomleo7/Checka11y.css */ appeared in a few separate sass files:
src/warnings/checka11y-warnings.scss
src/errors/checka11y-errors.scss
src/checka11y.scss
Then we we compile all the SCSS together, those comments appear in the compiled CSS file based on the order of each @use rule in checka11y.scss.
Flow:
checka11y.scss is the main SCSS file that loads the /warnings/* and /errors/* files.
The _customisation.scss partial gets loaded first (after _variables) so that partial is what appears first when compiling checka11y.css. There isn't anything special about _customisation.scss, its just first in the @use "loading" order when compiling the main css file, if we put the comment instead into _variables, then we would have to make sure its not loaded in many files otherwise the comment would appear multiple times like the original state.
tldr; add the comment into the partial that gets loaded first into the main file, then it can appear once at the top of checka11y.css as expected.
@tannerdolby so I didn't think of this when looking at your PR, but I created a shared/_license.scss file that gets imported vua @use into checka11y.scss, errors/checka11y-errors.scss and warnings/checka11y-warnings.scss.
I saw your comment regarding only using this comment in the warnings file because otherwise it'd be duplicated... well, it turns out that a nice feature of @use is that it won't duplicate, so even though I have written @use './shared/_license.scss 3 times, it only gets imported once, causing it to render as we expect for all 3 stylesheets.
No doubt though your PR got us closer to what we wanted, I was struggling to figure out what you found it.
@jackdomleo7 I'm glad I was able to help! Nice one using the _license.scss partial instead of the "hackish" solution I proposed. I just had a look at ab3856f and that is a much better approach. Stoked we were able to track this down. Feel free to ping me about any other issues in this project if you need an extra hand in the future.
This file contains hidden or 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
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.
Description
Fixes #119
The comment appearing thrice was because
/*! Checka11y.css v1.3.3 | MIT License | github.com/jackdomleo7/Checka11y.css */appeared in a few separate sass files:src/warnings/checka11y-warnings.scsssrc/errors/checka11y-errors.scsssrc/checka11y.scssThen we we compile all the SCSS together, those comments appear in the compiled CSS file based on the order of each @use rule in checka11y.scss.
Flow:
_customisation.scsspartial gets loaded first (after _variables) so that partial is what appears first when compilingchecka11y.css. There isn't anything special about _customisation.scss, its just first in the @use "loading" order when compiling the main css file, if we put the comment instead into_variables, then we would have to make sure its not loaded in many files otherwise the comment would appear multiple times like the original state.Why is this important?
Fixes an annoying bug that was encountered awhile ago while working on another ticket.
Covered test cases
No test cases modified. Tests still pass as expected with
npm run test.Did you test on all major browsers?
Other details
T&Cs