This is intended to reduce the number of breaking change releases to only 1, document the expected upgrade process both within EUI and by consuming applications, and be transparent about our timeline.
https://github.com/elastic/eui/tree/feature/css-in-js | #4511
In rough order of completion
@emotion/react (soon) from this point forward using only the generated CSS is not supported, EUI must be used through React@chandlerprall, I want to work on this feature, Could you please tell me how should i proceed
@hetanthakkar1 this doesn't have discrete, well-defined tasks at the moment. When the core functionality has landed, we will create a new [Meta] issue similar to #1557 in order to track the SCSS->Emotion conversion progress. At that point we'll be able to take contributions in this area; for now, we are still exploring internally and laying the ground work for that process.
okay @chandlerprall thank you
@hetanthakkar1 , We've got a great list of good-first-issues that you may want to start with.
@cchaos yeah! thank you. I will check them out
Support EuiIcon coloring/theming
Support for theming EuiIcon will require continued use of class names (or other DOM selectors), but can still be done in with Emotion. Targeting paths not accessible from the component file itself (e.g., fillSecondary, fillNegative) will be done in much the same manner as in Sass; something like:
const iconStyles = css`
[base styles]
&.euiIcon--app {
fill: ${theme.colors.euiTextColor};
// This provides the default secondary color
.euiIcon__fillSecondary {
fill: ${makeGraphicContrastColor(theme.colors.euiColorSecondary)};
}
}
`
There is likely to be a different pattern for adding stateful classes/logic for things like .euiIcon--app, but the gist remains.
Just to confirm, we'll still be able to easily override things, right?
I have 200 lines of CSS that override EUI, for instance, for #2184 I added
.euiButton {
transform: none;
}
Just to confirm, we'll still be able to easily override things, right?
Yes. Class names will be available for the foreseeable future. They will eventually be deprecated, but some other method will be recommended.