Light and dark themes in a custom format #4700
-
Hi, I'm currently developing a custom HTML format which provides both a light and dark theme. I have something like the following in my theme:
light: [bookup.scss]
dark: [bookup.scss, bookup_dark.scss] This is working fine, but maybe the custom format users will want to only use the light theme, or only the dark theme, or even provide both but with the dark one by default. Is there a way to provide such a feature in a custom format ? I took a look at the documentation but didn't find a way to do this. Thanks in advance ! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Right now I don't know if a way to conditionalize this except to provide a number of output variants like: _extension.yaml contributes:
formats:
html:
theme:
light: [bookup.scss]
dark: [bookup.scss, bookup_dark.scss]
html+light:
theme: bookup.scss
html+dark:
theme: [bookup.scss, bookup_dark.scss]
html+prefer-dark:
theme:
dark: [bookup.scss, bookup_dark.scss]
light: [bookup.scss] The user would then have to use the format in the project/document to control the theme behavior. I think this should work... |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply ! What would be the way to use the format in a document in this case ? I tried to create an Am I missing something ? |
Beta Was this translation helpful? Give feedback.
-
No you definitely are not - it is in't working for me either (though I'm not 100% sure it did previously). I am going to open an issue for me to investigate. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the report @juba - #4731 has been closed and this should work in next pre-release |
Beta Was this translation helpful? Give feedback.
Right now I don't know if a way to conditionalize this except to provide a number of output variants like:
_extension.yaml
The user would then have to use the format in the project/document to control the theme behavior. I think this should work...