Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

fix(typography): Use unquote for setting font-family in variables. #4665

Merged

Conversation

williamernest
Copy link
Contributor

While this did technically work, it semantically doesn't match the way we recommend users set the font-family.

@mdc-web-bot
Copy link
Collaborator

All 639 screenshot tests passed for commit d04972a vs. master! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 639 screenshot tests passed for commit 81d1869 vs. master! 💯🎉

@@ -22,7 +22,7 @@

@import "./functions";

$mdc-typography-font-family: Roboto, sans-serif !default;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does our override mixins break if we set without quotes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which override mixins? The mdc-typography mixins ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, mixins / functions that use this variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This variable is used below in the font styles map, but I would assume that our screenshot tests would break if the mixins/functions would break with this change.

Copy link
Collaborator

Choose a reason for hiding this comment

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

unquote("Roboto, sans-serif") seems to be same as Roboto, sans-serif. I looked at our typography mixins / functions, we don't seem to validate this type anywhere.

$fonts: unquote("Arial, sans-serif");
@debug type-of($fonts); // Return string

$fonts: Arial, sans-serif;
@debug type-of($fonts); // Return list

font-family: $fonts; // font-family can accept both list & string type.

Having said that this change looks good to me. But sass automatically type casts the list to string when applied to CSS property as mentioned above.

WDYT?

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 think either way works for me, as long as we're consistent in both what we recommend users use (via docs) and what we use.

@moog16
Copy link
Contributor

moog16 commented May 15, 2019

@williamernest did you want to merge this?

@williamernest
Copy link
Contributor Author

Yes.

@mdc-web-bot
Copy link
Collaborator

All 687 screenshot tests passed for commit e50f494 vs. master! 💯🎉

@williamernest williamernest merged commit 8d8f3fc into master May 15, 2019
@williamernest williamernest deleted the fix/typography/update-font-family-to-use-unquote branch May 15, 2019 23:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants