-
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
refactor: replaced hardcoded CSS with CSS variables #40
refactor: replaced hardcoded CSS with CSS variables #40
Conversation
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.
Please hoist all the CSS variables to one of the root CSS files.
We need to be able to change it in a single place to apply the themes later.
src/data.json
Outdated
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.
This change is unrelated to the Issue.
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.
fixed
src/components/Bubble/Bubble.css
Outdated
@@ -1,7 +1,7 @@ | |||
.bubble { | |||
border: 1px solid var(--light-grey); | |||
border: var(--bubble-border); | |||
color: var(--light-grey); |
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.
It should be --bubble-text-color
here
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.
Is this what I should have instead?
:root {--bubble-text-color: var(--light-grey) }
.bubble {
color: var(--bubble-text-color);
}
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.
Yes
src/components/Bubble/Bubble.css
Outdated
flex-shrink: 0; | ||
padding: var(--bubble-padding); | ||
border-radius: var(--bubble-border-radius); | ||
flex-shrink: var(--bubble-flex-shrink); |
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.
This is part of the layout, no need to convert it to a CSS variable.
Please review all the tokens that don't need this abstraction (all the flex-direction
, display, etc)
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.
updated
src/components/Category/Category.css
Outdated
gap: 12px; | ||
display: var(--category-display); | ||
flex-direction: var(--category-flex-direction); | ||
align-items: var(flex-start); |
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.
I guess this is a fluke.
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.
i dont understand, does this need to be fixed or this is the correct way to do it?
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.
This is a layout property so it should not be in a variable for the scope of this Issue.
But the "fluke" part is that you forgot the --
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.
updated
src/components/Category/Category.css
Outdated
font-weight: var(--category__title-font-weight); | ||
font-size: var(--category__title-font-size); |
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.
What do you think about refactoring this to a single font
shorthand property, so we have a single CSS variable for those cases?
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.
that sounds like a good idea. made some changes regarding it, please review.
src/components/Category/Category.css
Outdated
list-style-position: var(--category_bullet_bulletpoints-list-style-position); |
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.
Those are layout properties too.
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.
updated
4aa8bbd
to
6f120c1
Compare
6f120c1
to
555b196
Compare
do I need any changes on this PR before merging it? |
As this PR is stale, I will close it. Please feel free to reopen it once ready 🙏 |
No description provided.