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

[EuiGlobalStyles]: Support adding partial global styles #7839

Closed

Conversation

mgadewoll
Copy link
Contributor

@mgadewoll mgadewoll commented Jun 17, 2024

Summary

relates to #7822

This PR updates EuiGlobalStyles to support conditionally enabling/disabling global base styles instead of completely disabling all added styles via <EuiProvider globalStyles={false} />
This would allow for a more flexible usage in non-Kibana specific contexts, e.g. EUI+.

The default behavior remains as is (all styles are enabled by default).

The new API allows to disable specific parts of the global styles manually, for example:

const CustomStyles = () => <EuiGlobalStyles hasReset={false} />

<EuiProvider globalStyles={CustomStyles} />

QA

  • review the categorization of styles if it makes sense and is logical (there is currently no implementation of this yet to test)

General checklist

  • Browser QA
    • Checked in both light and dark modes
    • Checked in mobile
    • Checked in Chrome, Safari, Edge, and Firefox
    • Checked for accessibility including keyboard-only and screenreader modes
  • Docs site QA
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately.
    • If applicable, added the breaking change issue label (and filled out the breaking change checklist)
  • Designer checklist
    • Updated the Figma library counterpart

@mgadewoll mgadewoll changed the title [EuiGlobalStyles]: Support adding partial global styles conditionally [EuiGlobalStyles]: Support adding partial global styles Jun 17, 2024
@mgadewoll mgadewoll marked this pull request as ready for review June 17, 2024 17:24
@mgadewoll mgadewoll requested a review from a team as a code owner June 17, 2024 17:24
@kibanamachine
Copy link

Preview staging links for this PR:

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@cee-chen
Copy link
Member

I left a comment on the originating issue for this - generally, I'm not a huge fan of adding production-impacting features for non-production use cases, and would prefer we turn off EUI's global styles in docusaurus and recreate them manually if needed.

That being said, if we truly prefer this feature, I'd request that we add unit tests for each config/permutation and snapshot the CSS output. That being said, let's hold off on starting that until we determine whether we want to move forward and if we do, what granularity of customization is needed.

@mgadewoll mgadewoll marked this pull request as draft June 19, 2024 07:26
Copy link

👋 Hey there. This PR hasn't had any activity for 90 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

Copy link

❌ We're automatically closing this PR due to lack of activity. Please comment if you feel this was done in error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants