Soda.css - "Go fizz™"
Soda.css is a small CSS project that offers clean default styling templates and a simple color palette.
If your project requires more complicated features, such as dynamic interactions or component stylings, perhaps you can try out other libraries, for example, Bootstrap or Tailwind CSS.
The project is open source and is protected under the MIT license. See license in Soda.css/LICENSE
.
All changes can be found in Soda.css/CHANGELOG
.
Let me know if you have any questions or requests on Discord: @therock2t
.
Open a terminal and run the following commands:
git clone https://github.com/DmmDGM/soda.css
cd soda.css
npm install -g sass@latest
sass --no-source-map --style=compressed src:out
Visit https://github.com/DmmDGM/soda.css/releases and install the latest version.
It is possible to apply an alpha channel to any pre-defined hex color by using the relative rgb syntax:
rgb(from [color] r g b / [alpha])
button {
background-color: rgb(from var(--sd-red) r g b / 0.5);
border-radius: 5px;
cursor: pointer;
padding: 5px 10px;
transition: background 0.2s ease;
}
button:focus-visible, button:hover {
background-color: var(--sd-red);
}
Warning
Requires the use of relative CSS, which might not be supported on older browsers. Check browser compatibility for more information.
Soda.css offers a wide variety of colors and shades. All colors begin with the prefix --sd
:
a {
color: var(--sd-blue);
}
button {
background-color: var(--sd-red);
}
Use the *-l[number]
and *-d[number]
suffix to make the color lighter or darker:
a {
color: var(--sd-blue);
transition: color 0.2s ease;
}
a:focus-visible, a:hover {
color: var(--sd-blue-d20);
}
button {
background-color: var(--sd-red);
cursor: pointer;
transition: background 0.2s ease;
}
button:focus-visible, button:hover {
background-color: var(--sd-red-l10);
}
Note
Some colors have different limits to how light or dark they can be.
For example, red
has an upper limit of *-l15
and a lower limit of *-d50
, while gray
has an upper limit of *-l10
and a lower limit of *-d15
.
See Full List of Soda.css Colors for more information.
Additionally, all colors have a light-*
and a dark-*
alias, which correspond to the -l10
and -d20
shades respectively.
/* ... */
a:focus-visible, a:hover {
/* color: var(--sd-blue-d20); */
color: var(--sd-dark-blue);
}
/* ... */
button:focus-visible, button:hover {
/* background-color: var(--sd-red-l10); */
background-color: var(--sd-light-red);
}
Soda.css does not use a module-based system. Therefore, there are no official way to disable certain features in Soda.css. However, you can disable them manually by deleting the corresponding code or overwriting them in the compiled code.
Alternatively, if you only use Soda.css for the custom colors, you can try out Sodalite.css.
By default, Soda.css will automatically style the entire document to provide a clean starting template for your project. If this is an unwanted behavior, use the following CSS after the initialization of Soda.css to revert the changes:
* {
background: initial;
border: initial;
color: initial;
font: initial;
height: initial;
margin: initial;
outline: initial;
padding: initial;
scrollbar-color: initial;
scrollbar-width: initial;
text-decoration: initial;
width: initial;
}
Alternatively, you can simply delete the relevant styles in your compiled Soda.css.
Note
For Soda.css v1.1.0 and above, you can use the Sodalite.css option.
Below is the full list of available Soda.css colors:
Note
All colors have a light-*
and a dark-*
alias, which correspond to the *-l10
and *-d20
shades respectively.