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

Moved Accordion to css modules #398

Merged
merged 9 commits into from
Jul 19, 2023
Merged

Conversation

hexnickk4997
Copy link
Contributor

@hexnickk4997 hexnickk4997 commented Jul 14, 2023

Description

Moved one component to CSS Modules so we can take a look how migration is going and if everyone likes it.

Demo

CSS Modules desktop

Screenshot 2023-07-14 at 14 28 20

CSS Modules mobile

Screenshot 2023-07-14 at 14 28 49

CSS Modules dark

image

Styled Components desktop

Screenshot 2023-07-14 at 14 29 04

Styled Components mobile

Screenshot 2023-07-14 at 14 29 12

Review notes

Moved to SASS instead of CSS, because it looks like it's not possible to reuse media queries with CSS & CSS variables. Trying to use as less SASS syntax as possible, right now it's only used for breakpoints & media queries.

Breakpoints were implemented similarly as https://getbootstrap.com/docs/5.0/layout/breakpoints/

default exports → named exports.

Storybook must import from '.' so we can make sure, that we are actually exposing from the package everything we show on demo stand.

@hexnickk4997 hexnickk4997 requested review from a team as code owners July 14, 2023 12:34
@hexnickk4997 hexnickk4997 requested a review from Jabher July 17, 2023 14:13
})
}

const main = async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

that smells gulp

Copy link
Contributor

Choose a reason for hiding this comment

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

can there be better solution? whether using vite or not

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is rollup plugin https://www.npmjs.com/package/rollup-plugin-copy and there is vite plugin https://www.npmjs.com/package/vite-plugin-static-copy, rollup plugin is somehow popular, but it's unclear if this plugin is supported right now or will be supported in the future, there is also only one maintainer. So it feels like it's easier to implement similar plugin ourselves than getting yet another dependency.

@@ -0,0 +1,38 @@
:root {
--lido-color-dark-theme-opacity: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

commas

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed 👍

@hexnickk4997 hexnickk4997 requested a review from Jabher July 18, 2023 10:36
Comment on lines 25 to 27
className={`${styles.arrow} ${
isExpanded ? styles.arrowExpanded : ''
}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

with classnames it will look like cn(styles.arrow, {[styles.arrowExpanded]: isExpanded}), consider bringing it to the project (it will be useful anyway)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, added

@hexnickk4997 hexnickk4997 merged commit b7a09bc into v4 Jul 19, 2023
@hexnickk4997 hexnickk4997 deleted the feature/ui-831-migrate-accordion branch July 19, 2023 11:05
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.

2 participants