-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix/styles and types cleanup #491
Conversation
… use theme instead of tokens.
Remembered the old issue #225 that can be closed when this PR is ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments here and there but none shouldn't be any real problem. Suggestions here and there to open discussion.
Will next test library with test benches.
…r dependency in theme utils.
…xplicit theme prop definintion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work nicely when smoke tested in CRA-TS and next.js projects.
Good work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of changes for sure, but seems to work as advertised. Good work :)
Description
This maintenance PR removes redundant abstractions and typings and simplifies styles handling. Theme handling is refactored to use a provider pattern instead of constant theme. In additions, some minor improvements to folder structure are introduced.
All snapshots remain unchanged.
Motivation and Context
Current styles and types implementations date back over two years to situation where the goal was to have an unstyled abstraction of all components. This is no longer the goal and most of these abstractions have become redundant.
To simplify the codebase, the theme and tokens handling had to be refactored. Theme is now provided via context and can be customized when needed. Components only use the theme via the context and do not import anything else from the theme directly. Theme utils are still used directly, but style related common tools are now located under utils.
In addition, css-in-to-js had multiple vulnerabilities due to no updates and was removed as inspired by PR:#489
Removing of custom Reach-UI typings resulted in simplified implementation of LanguageMenu, which no longer supports custom components or menu popover class names.
How Has This Been Tested?
Tested on MacOS using Chrome, Edge and Safari with VoiceOver. Tested using styleguidist build, CRA-TS and SSR test applications via verdaccio. In addition, tested with styleguidist using Android and Chrome.
Release notes
Theme and styles:
Directory structure:
Types:
LanguageMenu: