Need script to generate auto.css #6

Closed
opened 2022-09-19 21:04:18 -06:00 by crystal · 0 comments

This theme supports both light and dark mode. Normally, switching between the two modes requires having the css files for both modes installed and manually selecting which one you want in user's appearance settings. It is possible to combine both modes into a single css file that will automatically select the correct mode depending on the user's operating system or browser preferences using CSS media queries. This is how the auto theme on CrystalCommit works.

The different modes are deliberately stored in two different files to allow the user to override the automatic mode by selecting the respective option in their appearance settings, for example if they would like to use the dark theme and their browser does not support the prefers-color-scheme media query. I do not want to ship the auto.css in the repository because it's contents are basically just the two existing files combined together, thus further commits would require two identical copies of each changed line.

It is very easy to generate the auto.css from the existing files. You must simply place the contents of of the light mode file into a new file, add the appropriate media query to the end, and place the contents of the dark mode file into the media query section. This issue shall stay open until I have created a gen-auto.sh script to automate this process.

This theme supports both light and dark mode. Normally, switching between the two modes requires having the css files for both modes installed and manually selecting which one you want in user's appearance settings. It is possible to combine both modes into a single css file that will automatically select the correct mode depending on the user's operating system or browser preferences using CSS media queries. This is how the `auto` theme on CrystalCommit works. The different modes are deliberately stored in two different files to allow the user to override the automatic mode by selecting the respective option in their appearance settings, for example if they would like to use the dark theme and their browser does not support the `prefers-color-scheme` media query. I do not want to ship the `auto.css` in the repository because it's contents are basically just the two existing files combined together, thus further commits would require two identical copies of each changed line. It is very easy to generate the `auto.css` from the existing files. You must simply place the contents of of the light mode file into a new file, add the appropriate media query to the end, and place the contents of the dark mode file into the media query section. This issue shall stay open until I have created a `gen-auto.sh` script to automate this process.
crystal added this to the Delightful milestone 2022-09-19 21:06:53 -06:00
crystal added the
enhancement
label 2022-09-19 21:19:16 -06:00
crystal referenced this issue from a commit 2023-01-16 21:32:27 -07:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: crystal/committed-violet#6
There is no content yet.