Skip to content

[Emotion] Figure out what exports we do and don't want to make public #7025

Closed as not planned

Description

@cee-chen

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:

  1. 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.ts files from being exported, we first need to account for consumers who are using Sass/CSS-in-JS variables & mixins that are component specific:
  2. 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 euiFormVariables and euiHeaderVariables.
    Instead of moving these style variables outside our .styles.ts files and continuing to export them publicly, @tkajtoch has suggested switching them to CSS variables instead. This will involve:

    1. 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)
    2. Each component usage should check if modify exists in the nearest EuiThemeProvider and if it does, render new scoped definitions for each CSS var
    3. @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
  3. In our compile-eui and dtsgenerator scripts, ignore/skip all *.styles.ts files

  4. 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:

    1. Why some of them are hooks and some are not (we should likely eliminate all hooks and simply require the euiThemeContext to be passed in, this is also frankly easier for Emotion theme usage)
    2. Why some mixins/functions are in global_stylings and some are in theme/amsterdam
    3. Which should even be publicly available, and which we should make internal/EUI-only

Activity

  1. added
    Stale
    on Oct 4, 2024
  2. removed
    Stale
    on Oct 14, 2024
  3. github-actions commented on Sep 22, 2025

    @github-actions

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

  4. added
    stale-issue
    on Sep 22, 2025
  5. github-actions commented on Mar 21, 2026

    @github-actions

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

  6. added
    stale-issue-closed
    on Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    emotionstale-issuestale-issue-closed

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions