-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add support for nested child selectors #25
Comments
Any news regarding this problem? 😟 Thanks |
@satazor Hm, your code gives me the warning E.g. this code works fine for me with version 2.7.5: <div className={`${styles.container} ${styles['container-green']} ${styles.isLoading}`}>
This container is green
</div> Can you maybe submit a failing test as a PR? |
Doesn't work for me either. Webpack Loader
styles.css.wrapper {
background: blue;
color: white;
& .test {
color: red;
}
} React Componentexport const Home = () => (
<div className={styles.wrapper}>
<h1 className={styles.test}>Doesn't work</h1>
</div>
) |
Hmm, if that's the case, that's an error. However, do you even need that Anyway if you find an error, it would be helpful if you could submit a PR with a failing test case. |
It's postcss-nesting which is based on the official CSS Nesting Module Level 3 Spec. So I guess I either have to quit using it and revert back to the more verbose: .wrapper .test {} or I can't use this great plugin |
Any news regarding this problem? Thanks! |
@atfzl I am willing to help. Can you describe what needs to be done? |
@olgenn I tried reproducing the issue but could not reproduce it. I tried the following setup and it is working correctly, may be I am missing something. Please help. import s from './parentClassSelector1.scss';
export default Foo = () => (
<div className={s.wrapper}>
<h1 className={s.test}>foobar</h1>
</div>
) .wrapper {
background: blue;
color: white;
&.test {
color: red;
}
} |
@atfzl The problem is different. I have this css styles .wrapper {
background: blue;
color: white;
& .test-text {
color: red;
}
} import s from './css.css';
export default Foo = () => (
<div className={s.wrapper}>
<h1 className={s.testText}>foobar</h1>
</div>
) And the console displays an error that class'.test Text ' does not exist. But the camelCase option is enabled. |
Ok, so the problem exists only for dash-cases class names and not on camelCase. Can you please confirm. |
@atfzl Yep. |
I tried the example that you provided and it is still working, I have created a PR with new tests and they are passing. Are you sure that you have the camelCase option enabled. |
@atfzl 7b86ff1#diff-0361dac614e957fd8929e88158cb5b9bR341 There must be |
I have fixed the PR with |
I think i have found the problem. The nested syntax works with scss but not css. |
I use postcss. Files extension |
I don't think this would be fixed so easily because it is dependent on |
@atfzl Thank you, I have time to wait. Maybe you should write to developers |
@olgenn over a year later, did you ever get progress on this issue? I've had to disable the plugin to consume the full postcss capabilities, but the linting was extremely helpfull.. |
The linter does not recognise .container.isLoading, even though they exist.
See #15
The text was updated successfully, but these errors were encountered: