Repository navigation
Description
Currently, every single *.styles.ts component file is being exported in EUI as well as typed in eui.d.ts. As a team, we should tackle the following behaviors:
-
Determine whether or not we as a team want to make component styles publicly
- After a brief discussion in a team sync, we decided "not". Our current styles are incredibly specific to Emotion (due to the usage of
css``syntax - if we had used object styles instead, this would potentially be different/more flexible). It currently doesn't make much sense to make them reusable. - NOTE: If you have strong thoughts on/against the above, please feel free to leave a comment in this issue - we're open to discussing it!
- Make it clear in our documentation that we only offer styled components going forward, not styles themselves (or rather, the style utilities we offer should be very broad and intentional and generally not component-specific)
- However, before we can remove all
.styles.tsfiles from being exported, we first need to account for consumers who are using Sass/CSS-in-JS variables & mixins that are component specific:
- After a brief discussion in a team sync, we decided "not". Our current styles are incredibly specific to Emotion (due to the usage of
-
Some components have style-related variables that may need to be reused by consumers, or even by other components within EUI. Examples of these are
euiFormVariablesandeuiHeaderVariables.
Instead of moving these style variables outside our.styles.tsfiles and continuing to export them publicly, @tkajtoch has suggested switching them to CSS variables instead. This will involve:- Declaring these component style vars once at the top level in our global styles (ensuring consumers have access to the default vars everywhere in the app)
- Each component usage should check if
modifyexists in the nearestEuiThemeProviderand if it does, render new scoped definitions for each CSS var - @tkajtoch also suggested adding a hook that exports the style vars later, although I'm not totally sure what his vision was in mind for that
-
In our compile-eui and dtsgenerator scripts, ignore/skip all
*.styles.tsfiles -
Audit & standardize all exported
global_stylings/mixins/functions
EUI currently has several Emotion “hooks” we’re exporting, several decisions (or lack therefore) are confusing around them:- Why some of them are hooks and some are not (we should likely eliminate all hooks and simply require the
euiThemeContextto be passed in, this is also frankly easier for Emotion theme usage) - Why some mixins/functions are in
global_stylingsand some are intheme/amsterdam - Which should even be publicly available, and which we should make internal/EUI-only
- Why some of them are hooks and some are not (we should likely eliminate all hooks and simply require the
Activity
emotion#3912github-actions commentedon Sep 22, 2025
👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.
github-actions commentedon Mar 21, 2026
❌ Per our previous message, this issue is auto-closing after having been open and inactive for a year. If you strongly feel this is still a high-priority issue, or are interested in contributing, please leave a comment or open a new issue linking to this one for context.