-
Notifications
You must be signed in to change notification settings - Fork 20
Try CSS variable again #545
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
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
00f72e0
Add styles based on the documentation tool
humitos 24d7869
Use a reactive property to add specific classes
humitos f3477b7
Use `tool=sphinx` `tool-theme=furo` to add CSS rules
humitos 053d931
Remove unused code
humitos 8c337ea
Update furo font size
humitos 9d08961
Update MkDocs Material font size
humitos 12057bf
Useful for Jupyter Book and others
humitos 28bb43c
Style for Antora
humitos 434f187
Update snapshots to match `tool=` and `tool-theme=` attrs
humitos 718b52a
Better comment
humitos 531c7e2
Rename attribute with a `data-` prefix
humitos 7f099cc
Adjust style a little more
humitos fe1319f
Show example of setting attributes and variables at parent DOM
agjohnson d6e86c6
Show example of setting attributes and variables at parent DOM (#484)
agjohnson 1446007
Small tweaks to font sizes
humitos ed87f06
Fix some tests
humitos 4d2a219
Handle error when checking mdBook
humitos 6b5db39
More fixes
agjohnson 12f1b3f
Update font sizes
agjohnson 5d2a33f
Working example of CSS layer defaults
agjohnson 1b2ce13
Merge branch 'main' into agj/css-variable-root-defaults
agjohnson a348a9e
Hack not needed because this is a native CSSStyleSheet
agjohnson d6c139b
Bad merge?
agjohnson 047c286
Drop unused doctools.css
agjohnson f847c0e
Tune var usage and defaults
agjohnson 69dfc0a
Lint
agjohnson 5844acf
Relint
agjohnson 92d9b08
Set global font-size and font-family
agjohnson dae5c61
Add CSS variable defaults for other addons
agjohnson 7a39c9d
Default CSS to separate file
agjohnson 78ab863
Add and fix variables for search customization
agjohnson 9d046a8
Fix lint issues with out of date pre-commit plugin
agjohnson 4b683a3
Add basic unit test example for flyout styles
agjohnson b567494
Lint fix
agjohnson f0f760f
Merge branch 'main' into agj/merge/css-variable-root-default-2
agjohnson 3b252bd
Merge commit 'f0f760f' into agj/css-variable-root-default-2
agjohnson 73de0c8
Undo temporary file changes for illustration/testing
agjohnson 82cd5c0
Comment on test
agjohnson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
@layer defaults { | ||
:root { | ||
--readthedocs-font-family: | ||
"Lato", "proxima-nova", "Helvetica Neue", "Arial", sans-serif; | ||
--readthedocs-font-size: 1rem; | ||
} | ||
|
||
:root[data-readthedocs-tool="mkdocs-material"] { | ||
--readthedocs-font-size: 0.58rem; | ||
} | ||
|
||
:root[data-readthedocs-tool="antora"] { | ||
--readthedocs-font-size: 0.7rem; | ||
} | ||
|
||
:root[data-readthedocs-tool="mdbook"] { | ||
--readthedocs-font-size: 1.3rem; | ||
} | ||
|
||
:root[data-readthedocs-tool="sphinx"][data-readthedocs-tool-theme="furo"] { | ||
--readthedocs-font-size: 0.725rem; | ||
} | ||
|
||
:root[data-readthedocs-tool="sphinx"][data-readthedocs-tool-theme="immaterial"] { | ||
--readthedocs-font-size: 0.58rem; | ||
} | ||
} |
This file contains hidden or 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,29 @@ | ||
import styleSheetDefaults from "./defaults.css"; | ||
import styleSheetFlyout from "./flyout.css"; | ||
import styleSheetFiletreediff from "./filetreediff.css"; | ||
import styleSheetNotification from "./notification.css"; | ||
import styleSheetSearch from "./search.css"; | ||
|
||
import { CSSResult } from "lit"; | ||
|
||
// We use a native construct here as Lit's CSSResult is largely read only. | ||
export const defaultStyleSheet = new CSSStyleSheet(); | ||
|
||
const styleSheets = [ | ||
styleSheetDefaults, | ||
styleSheetFlyout, | ||
styleSheetFiletreediff, | ||
styleSheetNotification, | ||
styleSheetSearch, | ||
]; | ||
|
||
for (let styleSheet of styleSheets) { | ||
if (styleSheet instanceof CSSResult) { | ||
styleSheet = styleSheet.styleSheet; | ||
} | ||
for (const rule of styleSheet.cssRules) { | ||
if (rule instanceof CSSLayerBlockRule && rule.name == "defaults") { | ||
defaultStyleSheet.insertRule(rule.cssText); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.