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

refactor: replaced hardcoded CSS with CSS variables #40

Closed

Conversation

JCaiDev
Copy link
Contributor

@JCaiDev JCaiDev commented Sep 25, 2024

No description provided.

Copy link
Owner

@alcpereira alcpereira left a 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
Copy link
Owner

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.

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

@@ -1,7 +1,7 @@
.bubble {
border: 1px solid var(--light-grey);
border: var(--bubble-border);
color: var(--light-grey);
Copy link
Owner

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

Copy link
Contributor Author

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);
}

Copy link
Owner

Choose a reason for hiding this comment

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

Yes

flex-shrink: 0;
padding: var(--bubble-padding);
border-radius: var(--bubble-border-radius);
flex-shrink: var(--bubble-flex-shrink);
Copy link
Owner

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

gap: 12px;
display: var(--category-display);
flex-direction: var(--category-flex-direction);
align-items: var(flex-start);
Copy link
Owner

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.

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 dont understand, does this need to be fixed or this is the correct way to do it?

Copy link
Owner

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 --

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

Comment on lines 9 to 10
font-weight: var(--category__title-font-weight);
font-size: var(--category__title-font-size);
Copy link
Owner

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?

Copy link
Contributor Author

@JCaiDev JCaiDev Sep 29, 2024

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.

Comment on lines 42 to 43
list-style-position: var(--category_bullet_bulletpoints-list-style-position);
Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@JCaiDev JCaiDev force-pushed the designSystem/convert-to-CSS-variable branch 4 times, most recently from 4aa8bbd to 6f120c1 Compare October 3, 2024 04:46
@alcpereira alcpereira mentioned this pull request Oct 3, 2024
@JCaiDev JCaiDev force-pushed the designSystem/convert-to-CSS-variable branch from 6f120c1 to 555b196 Compare October 9, 2024 15:16
@JCaiDev
Copy link
Contributor Author

JCaiDev commented Nov 6, 2024

do I need any changes on this PR before merging it?

@alcpereira
Copy link
Owner

As this PR is stale, I will close it. Please feel free to reopen it once ready 🙏

@alcpereira alcpereira closed this Feb 2, 2025
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