Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 24 additions & 16 deletions src/base/_fonts.scss
Original file line number Diff line number Diff line change
@@ -1,49 +1,57 @@
@mixin _non-variable-font-face($name, $path, $parameter) {

@font-face {
font-family: $name;
src: url('../src/fonts/#{$path}/#{$parameter}.woff2') format('woff2'),
url('../src/fonts/#{$path}/#{$parameter}.woff') format('woff');
@if (type-of($parameter) == 'number') {
src:
url("../src/fonts/#{$path}/#{$parameter}.woff2") format("woff2"),
url("../src/fonts/#{$path}/#{$parameter}.woff") format("woff");

@if (type-of($parameter) == "number") {
font-weight: $parameter;
} @else {
}

@else {
font-style: $parameter;
}
}
}

@mixin _variable-font-face($name, $path, $style) {

@font-face {
font-family: 'Source Sans Pro Variable';
src: url('../src/fonts/#{$path}.woff2') format('woff2-variations'),
url('../src/fonts/#{$path}.woff2') format('woff2');
font-weight: 100 900;
font-family: "Source Sans Pro Variable";
font-style: $style;
font-weight: 100 900;
src:
url("../src/fonts/#{$path}.woff2") format("woff2-variations"),
url("../src/fonts/#{$path}.woff2") format("woff2");
}
}

@include _variable-font-face(
'Source Sans Pro Variable',
'source-sans-pro-latin-extended/variable-regular',
"Source Sans Pro Variable",
"source-sans-pro-latin-extended/variable-regular",
normal
);
@include _variable-font-face(
'Source Sans Pro Variable',
'source-sans-pro-latin-extended/variable-italic',
"Source Sans Pro Variable",
"source-sans-pro-latin-extended/variable-italic",
italic
);

// Fallback for browsers that don't support variable fonts

@each $style in 400, 600, 700, italic {

@include _non-variable-font-face(
'Source Sans Pro',
'source-sans-pro-latin-extended',
"Source Sans Pro",
"source-sans-pro-latin-extended",
$style
);
}

@include _non-variable-font-face(
'Source Code Pro',
'source-code-pro-latin',
"Source Code Pro",
"source-code-pro-latin",
400
);
6 changes: 3 additions & 3 deletions src/base/_typography.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use '_fonts';
@use "_fonts";

/**
* Promote consistent line spacing.
Expand All @@ -16,11 +16,11 @@ html {
*/

body {
font-family: "Source Sans Pro", sans-serif;
text-size-adjust: none; /* 1 */
word-wrap: break-word; /* 2 */
font-family: 'Source Sans Pro', sans-serif;

@supports (font-variation-settings: normal) {
font-family: 'Source Sans Pro Variable', sans-serif;
font-family: "Source Sans Pro Variable", sans-serif;
}
}
2 changes: 1 addition & 1 deletion src/demo/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

.demo-button {
color: colors.$primary-brand;
transition: transform motion.$speed-quick motion.$ease-out;

// TODO: These font styles are temporary, for demo purposes
font-family: inherit;
font-size: 18px;
transition: transform motion.$speed-quick motion.$ease-out;
Copy link
Member

Choose a reason for hiding this comment

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

Is transition temporary? If not, I'd recommend changing the temporary comment to a footnote style to make it clearer which lines it applies to.

Copy link
Member Author

Choose a reason for hiding this comment

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

Everything in demo is temporary.

Copy link
Member

Choose a reason for hiding this comment

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

If it's temporary, then you're good to go. :)

Copy link
Member

Choose a reason for hiding this comment

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

I just wanted to make sure that rule moving below the comment wasn't inadvertently confusing.

}

.demo-button:hover {
Expand Down