-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement modular scale theme utility function
This commit implements the `ms` shorthand function for polished's (1) `modularScale` helper with pre-configured base and ratio values. References: (1) https://polished.js.org Associated epic: #2 GH-64
- Loading branch information
1 parent
fa962a2
commit 724b2ba
Showing
3 changed files
with
31 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (C) 2018-present Arctic Ice Studio <[email protected]> | ||
* Copyright (C) 2018-present Sven Greb <[email protected]> | ||
* | ||
* Project: Nord Docs | ||
* Repository: https://github.com/arcticicestudio/nord-docs | ||
* License: MIT | ||
*/ | ||
|
||
import { modularScale } from "polished"; | ||
|
||
import typography from "../typography"; | ||
|
||
/** | ||
* Shorthand function for polished's `modularScale` helper with pre-configured base and ratio values. | ||
* | ||
* @method ms | ||
* @param {number} step The step to scale up or down. | ||
* @return {string} The calulcated scale with the `em` unit. | ||
* @author Arctic Ice Studio <[email protected]> | ||
* @author Sven Greb <[email protected]> | ||
* @see https://polished.js.org/docs/#modularscale | ||
* @since 0.3.0 | ||
*/ | ||
const ms = step => modularScale(step, typography.sizes.msBase, typography.sizes.msName); | ||
|
||
export default ms; |