eui icon indicating copy to clipboard operation
eui copied to clipboard

[EuiGlobalStyles]: Support adding partial global styles

Open mgadewoll opened this issue 1 year ago • 3 comments

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~
    • [x] Checked in Chrome, Safari, Edge, and Firefox
    • [ ] ~Checked for accessibility including keyboard-only and screenreader modes~
  • Docs site QA
  • Code quality checklist
  • Release checklist
    • [x] 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 avatar Jun 17 '24 15:06 mgadewoll

Preview staging links for this PR:

  • Docs site: https://eui.elastic.co/pr_7839/
  • Storybook: https://eui.elastic.co/pr_7839/storybook

kibanamachine avatar Jun 17 '24 17:06 kibanamachine

:green_heart: Build Succeeded

History

  • :green_heart: Build #2166 succeeded 496b9648a9715dbde900203ac43735dc90013286

elasticmachine avatar Jun 17 '24 17:06 elasticmachine

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.

cee-chen avatar Jun 18 '24 23:06 cee-chen

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

github-actions[bot] avatar Sep 17 '24 08:09 github-actions[bot]

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

github-actions[bot] avatar Sep 24 '24 08:09 github-actions[bot]