-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SOEOPSFY24-343 | configure custom modular typography
- Loading branch information
1 parent
a0eca39
commit f4f14c0
Showing
6 changed files
with
86 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Centennial Variables. | ||
*/ | ||
|
||
module.exports = function () { | ||
const modtype = {}; | ||
|
||
// Reponsive modular typography system | ||
// type-0 is the base step = 1em | ||
// type-1 to type-9 (largest) available | ||
// Each step includes difference font sizes and letterspacing for mobile, tablet and desktop breakpoints | ||
// Generate responsive modular typography steps from 1 to 9 | ||
for (let i = 0; i < 10; i += 1) { | ||
modtype[`type-${i}`] = { | ||
fontSize: `${(1.18 ** i).toFixed(2)}em`, | ||
letterSpacing: `${(-0.01 - (i - 1) * 0.002).toFixed(3)}em`, | ||
'@screen md': { | ||
fontSize: `${(1.9 ** i).toFixed(2)}em`, | ||
}, | ||
'@screen lg': { | ||
fontSize: `${(1.21 ** i).toFixed(2)}em`, | ||
}, | ||
}; | ||
} | ||
|
||
// Returned values. | ||
return { | ||
typography: { | ||
...modtype, | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* Momentum fonts | ||
* Centennial fonts | ||
*/ | ||
module.exports = function () { | ||
return { | ||
|