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

[CSS-in-JS] [Breaking] Better Getting Started page #5299

Merged

Conversation

cchaos
Copy link
Contributor

@cchaos cchaos commented Oct 20, 2021

Updated the Getting Started page with clearer instructions based on theme and best practices

And cleaned up some MD files to remove duplicate/outdated content

Screen Shot 2021-10-20 at 17 02 11 PM

🔔 Breaking: Fixed customizability of each theme

The way we were originally handling theme colors was with a base set of color tokens in global_styling that used the Sass !default mechanism. Then in our subsequent themes we were overriding these tokens by declaring a new set before their import which did not have the !default. This actually made it impossible for consumer to customize on top of that. So the only truly customizable theme was the legacy light theme.

This fixes that by moving all color tokens (whether duplicative or not) to their respective themes/name/_colors_light.scss and themes/name/_colors_dark.scss files. I also then deleted the one that exists in global_styling and updated any docs around that import.

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • [ ] Checked in mobile
  • [ ] Checked in Chrome, Safari, Edge, and Firefox
  • [ ] Props have proper autodocs and playground toggles
  • Added documentation
  • [ ] Checked Code Sandbox works for any docs examples
  • [ ] Added or updated jest and cypress tests
  • Checked for breaking changes and labeled appropriately
  • [ ] Checked for accessibility including keyboard-only and screenreader modes
  • [ ] A changelog entry exists and is marked appropriately

cchaos added 5 commits October 20, 2021 15:37
- Duplicates variables, but makes it actually capable of customization
- New files for code & vis colors that weren’t theme specific
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5299/

@thompsongl thompsongl mentioned this pull request Oct 21, 2021
21 tasks
@thompsongl
Copy link
Contributor

Just fixed the failing snapshot tests. Merge/rebase the css-in-js/breaking branch to update.

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5299/

@cchaos
Copy link
Contributor Author

cchaos commented Oct 26, 2021

Jenkins, test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5299/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5299/

@cchaos
Copy link
Contributor Author

cchaos commented Oct 27, 2021

This PR continues to fail on Cypress in CI and I don't know how to fix it.

README.md Outdated Show resolved Hide resolved
@import '@elastic/eui/src/theme_light.scss';
```

### Fonts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just trying to make sure I understand the overall intention with .md files vs. docs site pages, and the distinction being made with removals like this.

Is it that everything now in Getting Started shouldn't exist in a markdown file anymore? Are we tying to push people more towards the site for documentation?

Seems like we have mixed bag of documentation and consumers have to visit both the repo and the docs site for a full picture (this was the case before this PR, too 😄). Wondering if you have a broader strategy in mind.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah so my broader strategy is that for purely consumer style docs (using in your own projects), all those instructions need to live on our docs site, not buried in .md files. So I'm trying now to focus those .md files purely on contributors to EUI. Eventually we'll want to import our entire wiki folder to be displayed on our docs site too.

Copy link
Contributor Author

@cchaos cchaos Oct 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless that is, the .md file goes into very technical issues like icon failings and such. Those I haven't found a good place for yet in our docs site, so just pointing consumers in the general direction of .md if they get stuck and this PR just creates some high-level intro-style instructions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also removing mostly what has been duplicated in both places since we're not good at keeping 2 places up to date.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me; thanks for clarifying.

Eventually we'll want to import our entire wiki folder to be displayed on our docs site too.

Yes, I think that would solve a lot of confusion about where docs should go.

@thompsongl
Copy link
Contributor

This PR continues to fail on Cypress in CI and I don't know how to fix it.

I think there's a fix on master that just hasn't made its way into the feature branch yet

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the additional README change

Co-authored-by: Greg Thompson <[email protected]>
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5299/

@cchaos cchaos merged commit 59e3245 into elastic:css-in-js/breaking Oct 28, 2021
@cchaos cchaos deleted the css-in-js/breaking_getting-started branch November 2, 2021 22:13
thompsongl added a commit that referenced this pull request Nov 30, 2021
* emotion as peerDep; babel and typescript

* jest config

* isDefaultTheme util

* CL TODO

* update snapshots

* [CSS-in-JS] [Breaking] Deprecating EUI theme to Legacy (#5222)

* [CSS-in-JS] Global style reset with `emotion` (#5122)

* global reset with emotion

* amsterdam overrides

* text-size-adjust

* ams reset

* invert ::selection

* Renamed `isDefaultTheme` utility to `isLegacyTheme`

Default will mean something different when Amsterdam becomes default so I want to head this off now by checking for “Legacy”

* Quick cleanup

* Fixed up scrollbar function

* Removed `useEuiFont` in favor of a single reset on the elements that need it

* Added `body` key to global `font` for setting base body font settings at the global level

* Some more fixes based on new diff

* global reset with emotion

* amsterdam overrides

* text-size-adjust

* ams reset

* invert ::selection

* Renamed `isDefaultTheme` utility to `isLegacyTheme`

Default will mean something different when Amsterdam becomes default so I want to head this off now by checking for “Legacy”

* Quick cleanup

* Fixed up scrollbar function

* Removed `useEuiFont` in favor of a single reset on the elements that need it

* Added `body` key to global `font` for setting base body font settings at the global level

* Some more fixes based on new diff

* Pulling our reset from global styles

* SVG `hacks` directly in reset file

* Fixed reset import

* euiprovider; reset styles

* use euiprovider with emotion/cache in docs

* Decision clean up

* Fixing a few things for legacy dark mode based on not having a provider

* Revert "Fixing a few things for legacy dark mode based on not having a provider"

This reverts commit 127f12e.

* Actually keeping `colorMode` even if `theme = null`

* Fixing merge

* Moved reset sass folder to `legacy`

* fix wiki

* euiprovider docs

* fix provider docs

* remove commented import

Co-authored-by: cchaos <[email protected]>

* [CSS-in-JS] Add provider to generated codesandbox examples (#5253)

* add provider to generated codesandbox examples

* indentation

* euithemeprovider -> euiprovider

* legacy theme

* fix snapshot tests

* [CSS-in-JS] Provider for fullscreen examples; Context refactor (#5309)

* refactor to extract context component

* refactor for fewer updates on route changes

* refactor AppView to function component

* [CSS-in-JS] [Breaking] Better Getting Started page (#5299)

* Moved all color Sass files to their respective theme folders
- Duplicates variables, but makes it actually capable of customization
- New files for code & vis colors that weren’t theme specific
* Remove outdated theming wiki page
* Cleanup (in MD files too)

* fix heading level

* update changelog page regex to fully remove the master section

* manual merge

* update release script changelog regex

* Cleanup some docs

* Hide LanguageSelector tour on Getting Started page

* Some GS page cleanup

* PR feedback

* cl

* Apply suggestions from code review

Co-authored-by: Constance <[email protected]>

* lint fix

* make amsterdam default

* provider updates

* fix cypress styles

* PR feedback:

- Removed blank mixins file
- Added `yarn add` block for dependencies
- Added props table to bottom of Provider docs page

* move keydown inside useeffect

* Reusing correct Sass customization snippet under Customizing

* fix cypress path

* update export

Co-authored-by: Caroline Horn <[email protected]>
Co-authored-by: cchaos <[email protected]>
Co-authored-by: Constance <[email protected]>
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.

3 participants