Skip to content
Snippets Groups Projects
Unverified Commit 26fad7dd authored by Waldir Pimenta's avatar Waldir Pimenta Committed by GitHub
Browse files

docs: Mention caveat about variable dependencies (#555)


Looking at how the variables are defined in _variables.scss, with various dependencies between them aimed at ensuring a consistent color scheme, one might expect that redefining a given variable would affect the remaining styles that depend on it.

This is not the case, however, due to the order in which the files are processed. This PR edits the documentation to mention the non-propagating behavior of redefined variables, to better guide users that wish to customize the site using custom themes, and call their attention to the need to redefine the dependency relations as well.

Co-authored-by: default avatarMatt Wang <matt@matthewwang.me>
Co-authored-by: default avatarPatrick Marsceill <pmarsceill@users.noreply.github.com>
parent c980fd4a
No related branches found
No related tags found
No related merge requests found
...@@ -69,6 +69,10 @@ For example, to change the link color from the purple default to blue, include t ...@@ -69,6 +69,10 @@ For example, to change the link color from the purple default to blue, include t
$link-color: $blue-000; $link-color: $blue-000;
``` ```
Keep in mind that changing a variable will not automatically change the value of other variables that depend on it.
For example, the default link color (`$link-color`) is set to `$purple-000`. However, redefining `$purple-000` in a custom color scheme will not automatically change `$link-color` to match it.
Instead, each variable that relies on previously-cascaded values must be manually reimplemented by copying the dependent rules from `_variables.scss` — in this case, rewriting `$link-color: $purple-000;`.
_Note:_ Editing the variables directly in `_sass/support/variables.scss` is not recommended and can cause other dependencies to fail. _Note:_ Editing the variables directly in `_sass/support/variables.scss` is not recommended and can cause other dependencies to fail.
Please use scheme files. Please use scheme files.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment