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 modules #1302

Merged
merged 73 commits into from
Jun 7, 2023
Merged

css modules #1302

merged 73 commits into from
Jun 7, 2023

Conversation

mayank99
Copy link
Contributor

@mayank99 mayank99 commented May 23, 2023

Changes

Created a styles.js folder inside src that uses Vite to do CSS-modules processing. After processing, the iui- prefix becomes _iui3- (for example iui-button becomes _iui3-button). Not including hash yet to ease migration, but it will be a one-line change to add it in v4.

Vite will output two files: styles.css and style.js, both of which get copied into the published output of @itwin/itwinui-react. The styles.css file will need to be imported manually by users, and the styles.js file will be used inside polymorphic to get the transformed class names.

Made some tweaks in @itwin/itwinui-css to remove previous scoping mechanism (from #1031). Added :where to @itwin/itwinui-variables and required iui-root in all global styles.

Pending issues:

See branch preview: https://itwin.github.io/iTwinUI/1302/react/

Testing

Tested running dev and prod build of playgrounds and storybook. More extensive testing needed.

Docs

Updated starter templates and "getting started" pages. Added multiple changesets.

Updated migration guide: https://github.com/iTwin/iTwinUI/wiki/iTwinUI-react-v3-migration-guide#breaking-changes

@mayank99 mayank99 added this to the React 3.0 milestone May 23, 2023
@mayank99 mayank99 self-assigned this May 23, 2023
@mayank99 mayank99 requested a review from a team as a code owner May 23, 2023 12:45
@mayank99 mayank99 requested review from a team, gretanausedaite and LostABike and removed request for a team May 23, 2023 12:45
@mayank99 mayank99 mentioned this pull request May 23, 2023
22 tasks
@mayank99 mayank99 changed the title wip css modules May 23, 2023
@mayank99 mayank99 marked this pull request as draft May 23, 2023 12:46
@mayank99 mayank99 changed the base branch from dev to mayank/remove-cloneElement May 25, 2023 16:43
@mayank99 mayank99 changed the base branch from mayank/remove-cloneElement to dev May 25, 2023 16:44
@mayank99 mayank99 changed the base branch from dev to mayank/remove-cloneElement May 25, 2023 16:44
Base automatically changed from mayank/remove-cloneElement to dev May 30, 2023 13:44
@mayank99
Copy link
Contributor Author

mayank99 commented Jun 6, 2023

All styles and tests should be fixed now.

@mayank99 mayank99 force-pushed the mayank/css-modules branch from c133f8d to cfd43eb Compare June 6, 2023 21:40
@mayank99 mayank99 force-pushed the mayank/css-modules branch from cfd43eb to d69f216 Compare June 6, 2023 21:41
Copy link
Contributor

@gretanausedaite gretanausedaite left a comment

Choose a reason for hiding this comment

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

Maybe fixed by 2b900ff. Check again?

Works!

Code looks good.

@mayank99 mayank99 merged commit e0a5010 into dev Jun 7, 2023
@mayank99 mayank99 deleted the mayank/css-modules branch June 7, 2023 13:02
@mayank99 mayank99 mentioned this pull request Jun 7, 2023
@mayank99 mayank99 mentioned this pull request Sep 5, 2023
7 tasks
@imodeljs-admin imodeljs-admin mentioned this pull request Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants