Skip to content
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

[Meta] CSS-in-JS + theming rollout plan #4529

Closed
4 of 10 tasks
chandlerprall opened this issue Feb 16, 2021 · 9 comments
Closed
4 of 10 tasks

[Meta] CSS-in-JS + theming rollout plan #4529

chandlerprall opened this issue Feb 16, 2021 · 9 comments
Labels

Comments

@chandlerprall
Copy link
Contributor

chandlerprall commented Feb 16, 2021

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.

Feature branch

https://github.com/elastic/eui/tree/feature/css-in-js | #4511

PRs

Open issues/questions

  • Support EuiIcon coloring/theming

Upgrade process

EUI

  • TBD (how to convert components)

Consuming apps

  • TBD (babel, etc)
  • Vanilla JS support (Kibana plugins; basic, immutable theme variables)
  • SSR support (verify + link to emotion's docs)
  • Update Gatsby and Next starters

Rollout

In rough order of completion

  • Coordinate with Kibana ops team with implementing babel changes Enable CSS-in-JS styling with emotion kibana#98157
  • EUI breaking/major release with peerDep on @emotion/react (soon) from this point forward using only the generated CSS is not supported, EUI must be used through React
  • Convert components, including removing component-specific SCSS (over the remainder of the year)
  • Deprecate using EUI's SCSS mixins/variables
  • Deprecate using EUI's classnames
  • Remove class names (after a lengthy deprecation period)
@hetanthakkar
Copy link
Contributor

@chandlerprall, I want to work on this feature, Could you please tell me how should i proceed

@chandlerprall
Copy link
Contributor Author

@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.

@hetanthakkar
Copy link
Contributor

okay @chandlerprall thank you

@cchaos
Copy link
Contributor

cchaos commented Feb 23, 2021

@hetanthakkar1 , We've got a great list of good-first-issues that you may want to start with.

@hetanthakkar
Copy link
Contributor

@cchaos yeah! thank you. I will check them out

@thompsongl thompsongl pinned this issue Mar 4, 2021
@thompsongl
Copy link
Contributor

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.

@j-m
Copy link
Contributor

j-m commented Apr 14, 2021

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;
}

@thompsongl
Copy link
Contributor

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.

@cchaos
Copy link
Contributor

cchaos commented Aug 15, 2021

Closing this in favor of #3912, which I'm moved some of the still relevant info to.

@cchaos cchaos closed this as completed Aug 15, 2021
@thompsongl thompsongl unpinned this issue Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants