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

DEV: refactor font sizing into css custom variables #12746

Merged
merged 2 commits into from Apr 29, 2021

Conversation

featheredtoast
Copy link
Member

Refactor font sizing variables into CSS custom vars.

Allows any stylesheet to re-use CSS custom variables, regardless of how it's imported or compiled.

@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/cleaning-up-our-font-system/75396/30

@featheredtoast featheredtoast deleted the font-sizing-css-custom-vars branch April 17, 2021 22:07
@featheredtoast featheredtoast restored the font-sizing-css-custom-vars branch April 17, 2021 22:09
Copy link
Contributor

@pmusaraj pmusaraj left a comment

Choose a reason for hiding this comment

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

Very nice, just a few minor comments.

app/assets/stylesheets/common.scss Outdated Show resolved Hide resolved
$base-font-family: var(--font-family) !default;
$base-font-size-smallest: var(--base-font-size-smallest) !default;
$base-font-size-smaller: var(--base-font-size-smaller) !default;
$base-font-size: var(--base-font-size) !default;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming the SCSS vars are now legacy, the goal is to start using the CSS vars in stylesheets directly, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, we can indeed start moving those over 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

One thing to note, we might be carrying those variables for a while yet since we allow those variables to be used in themes and stylesheets, which is unfortunate but we can at least start renaming core vars!

@featheredtoast featheredtoast merged commit 849b786 into master Apr 29, 2021
@featheredtoast featheredtoast deleted the font-sizing-css-custom-vars branch April 29, 2021 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants