-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Allow CSS variables to manipulate theme #190
Changes from 2 commits
1aaaefd
c239050
c4148c4
aa92528
c3f3f84
f116d60
185c2cf
7f4892d
e15dffe
8ddd977
222e14e
e32c826
a156644
f8d70e3
c7a5e65
811e134
d2b7d88
d04e6c5
0f25c1b
8cac2e9
30eba8a
b3c61a7
a04d97c
146129e
3ab8f06
130af5b
8edd3ab
facbf8e
6d7c351
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
:root { | ||
/***************************************************************************** | ||
* Bootstrap variables are availlable: | ||
* https://getbootstrap.com/docs/4.0/getting-started/theming/#css-variables | ||
**/ | ||
|
||
/***************************************************************************** | ||
* Custom font | ||
**/ | ||
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800&display=swap'); | ||
|
||
/***************************************************************************** | ||
* Font size | ||
**/ | ||
--fs-base: 15px; /* base font size - applied at body / html level */ | ||
|
||
/* heading font sizes */ | ||
--fs-h1: 36px; | ||
--fs-h2: 32px; | ||
--fs-h3: 26px; | ||
--fs-h4: 21px; | ||
--fs-h5: 28px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this seems a typo? (28 doesn't really fit between 21 and 18 ;)) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes indeed! |
||
--fs-h6: 18px; | ||
|
||
/* smaller then heading font sizes*/ | ||
--fs-milli: 12px; | ||
|
||
/***************************************************************************** | ||
* Font family | ||
**/ | ||
--ff-base: 'Lato', sans-serif; | ||
--ff-heading: 'Open Sans', sans-serif; | ||
|
||
/***************************************************************************** | ||
* Color | ||
**/ | ||
--color-primary: #130654; | ||
--color-text-base: #333; | ||
--color-h1: var(--color-primary); | ||
--color-h2: var(--color-primary); | ||
--color-h3: var(--color-text-base); | ||
--color-h4: var(--color-text-base); | ||
--color-h5: var(--color-text-base); | ||
--color-h6: var(--color-text-base); | ||
--color-paragraph: var(--color-text-base); | ||
--color-link: #005b81; | ||
--color-link-hover: #e32e00; | ||
--color-headerlink: #c60f0f; | ||
--color-headerlink-hover: white; | ||
--color-preformatted-text: #222; | ||
--color-preformatted-background: #fafafa; | ||
|
||
/* admonition colors */ | ||
--color-admonition-base: var(--blue); | ||
--color-admonition-attention: var(--orange); | ||
--color-admonition-attention-light: #ffedcc; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure we need to necessarily add variables for all of those admonition types (we can always add later if there is demand for it). Maybe we could keep it on the 4 colors we use now. What I was originally thinking for those admonitions is to reuse the bootstrap There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Limit the admonition types is fine for me, semantics in css are not that important I think. Regarding the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I diggel into the sass color functions combined with css variables. All solutions available start from defining the colors either based in RGB (e.g. red: With RBG, it is possible to lighten a color by adding an alpha channel. Darkening the color is harder I think. The main disadvantage is the theme colors MUST be defined in either RGB, HSL and never Hex. Somehow this feels like a downside for the theme user who quickly wants to define his/her theme colors on top? @jorisvandenbossche @choldgraf do you have thoughts on this? |
||
--color-admonition-caution: var(--orange); | ||
--color-admonition-caution-light: #ffedcc; | ||
--color-admonition-warning: var(--red); | ||
--color-admonition-warning-light: #fdf3f2; | ||
--color-admonition-danger: var(--red); | ||
--color-admonition-danger-light: #fdf3f2; | ||
--color-admonition-error: var(--red); | ||
--color-admonition-error-light: #fdf3f2; | ||
--color-admonition-hint: var(--yellow); | ||
--color-admonition-hint-light: #fff6dd; | ||
--color-admonition-tip: var(--yellow); | ||
--color-admonition-tip-light: #fff6dd; | ||
--color-admonition-important: var(--blue); | ||
--color-admonition-important-light: #e7f2fa; | ||
--color-admonition-note: var(--blue); | ||
--color-admonition-note-light: #e7f2fa; | ||
|
||
/***************************************************************************** | ||
* Icon | ||
**/ | ||
|
||
/* font awesome icons*/ | ||
--icon-info-circle: '\f05a'; | ||
--icon-exclamation-circle: '\f06a'; | ||
--icon-lightbulb: '\f0eb'; | ||
--icon-question: '\f128'; | ||
--icon-exclamation-triangle: '\f071'; | ||
--icon-times-circle: '\f057'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make those relative (
em
) sizes?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could make those relative, but since we allow this to be defined in a 'setting', defining via
em
is harder to think about. Since 1em ==--fs-base
. Since mostly no inheritance happend on heading level, defining in pixels or ems is little difference I think.