-
Is there any way to reference a generated class name in a different For example, if I was to try and convert a css module file that looks like this, how would I do it? /* Same file class references. I'd expect this to generate 3 unique classes. */
.element1 { }
.element2 { }
.open.element1 { }
.open.element2 { } /* Different file class references (https://github.com/css-modules/css-modules#composing-from-other-files) */
.button {
color: white;
}
.button {
composes darkMode from '../pageStyles.css';
color: black;
} I found this reference to "nested selectors" in the docs, but it uses global names for the child selectors. import { makeStyles } from '@griffel/react';
const useClasses = makeStyles({
root: {
'& .foo': { color: 'green' },
'&.bar': { color: 'red' },
},
}); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
More context: My team is looking to update to Fluent 9. We've got a lot of Sass we're looking to replacing with Griffel. A common pattern we use is to create status (open/closed, light/dark, loading) classes on a components root element, and then use nested selectors to style elements. |
Beta Was this translation helpful? Give feedback.
-
Hey 👋 Has there been any updates to this feature idea ( |
Beta Was this translation helpful? Give feedback.
More context:
My team is looking to update to Fluent 9. We've got a lot of Sass we're looking to replacing with Griffel. A common pattern we use is to create status (open/closed, light/dark, loading) classes on a components root element, and then use nested selectors to style elements.