-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Bugfix/media-query and selectors placeholders #6
Bugfix/media-query and selectors placeholders #6
Conversation
- work with placeholders replacing selectors expressions - add test
I have added a test and fixed #7 |
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 fine, thanks for contributing man.
Did you test these changes in a real application with styled-jsx?
Nit pick can you remove the semicolons to keep it consistent with the other plugins?
test.js
Outdated
|
||
it('works with media queries placeholders', () => { | ||
assert.equal( | ||
plugin('p { display: block; @media %%styled-jsx-placeholder-0%% { color: red; } }', {}).trim(), |
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.
can you add a test for
@media (min-width: %%styled-jsx-placeholder-0%%) {}
and
@media (%%styled-jsx-placeholder-0%%) {}
@giuseppeg yes, I tried it in a real application with styled-jsx. I have removed semicolons. I also updated test for media queries. Unfortunately something like this:
is causing:
to fix that it would probably (maybe not) require another matcher. As far I know regex is computationally heavy so this case is not worth it in my opinion. Though I can try to fix it if you want. |
@Tomekmularczyk no worries, this is perfect for now. Awesome job <3 thank you so much. |
It's my first public PR ever on GitHub, so if done something against common rules, made too many commits or brute forced the solution, I would like to know and I will try to fix it.
I tested the library on my local project with a component like:
and it seems to work fine.