-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
remove empty media queries #89
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
remove empty media queries #89
Conversation
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.
Awesome, thanks @psren! A couple minor tweaks but happy to merge right after that.
| css.append(mediaQuery) | ||
|
|
||
| if(mediaQuery.nodes.length) { | ||
| // do not add media query without any rules or comments |
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.
Minor style changes but can you add a space after the if, and remove the comment? I think the code is expressive enough to me without it 👍
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.
done
__tests__/sanity.test.js
Outdated
| .then(result => { | ||
| expect(result.css).toBe('') | ||
| }) | ||
| }) |
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.
Another minor change but can you make sure this file ends with a newline character?
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.
done
__tests__/sanity.test.js
Outdated
| }) | ||
| }) | ||
|
|
||
| it('Do not change css if tailwind is not used at all', () => { |
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.
One more comment actually! Try to name the tests so that they read properly starting with the word "it". In this case maybe this would be a good name:
"does not add any CSS if no Tailwind features are used"
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.
done and thanks for the input :-)
|
Awesome, thanks @psren! |
Fixes issue from that comment: #16 (comment)
@adamwathan wants this to happen, so here it is ;-)
#16 (comment)
Empty media queries are added if i do not use
@tailwind utilitiesand use only preflight.