aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 67451c98a65b30a1e000b5a17cbbfb9ef49c8141 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# dark_theme_impl_example

This repository contains the backend part or the light/dark theme switch implementation example for websites using
sass/less compilers without using css3 variables and also without webpack or similar crap.

The [stylesheet](htdocs/scss/app.scss) used for this example is very minimalistic and contains only few rules, but that's
only for demonstration purposes. This technique has been used in real project for years on very large and very complicated
set of stylesheets (hundreds of kilobytes when compiled and minimized) and proven to be reliable.

Check out my [blog post](https://ch1p.io/dark-theme-scss-less-without-css3-variables/edit/) if you want to learn more.

## Requirements

- `sassc` compiler (in debian, the package is called `sassc`) for scss
- nodejs

Clone repository:

```
git clone https://git.ch1p.io/dark_theme_impl_example.git
cd dark_theme_impl_example
```

Install dependencies:
```
npm i
```

Build the scss example:
```
make scss
```

Build the less example:
```
make less
```

Check out results in `htdocs/dist-less` or `htdocs/dist-scss`.

# License

MIT