Use modern RGB format (fixes #54)

This commit is contained in:
daudix
2024-08-23 23:18:59 +03:00
parent 8411000de7
commit 7808d906f1
8 changed files with 162 additions and 105 deletions

View File

@ -123,7 +123,7 @@ Duckquill respects chosen primary color everywhere. To use your own, simply chan
```toml
[extra]
primary_color = "#3584e4"
primary_color_alpha = "rgba(53, 132, 228, 0.2)"
primary_color_alpha = "rgb(53 132 228 / 0.2)"
```
Additionally, you can set a separate color for dark mode:
@ -131,7 +131,7 @@ Additionally, you can set a separate color for dark mode:
```toml
[extra]
primary_color_dark = "#ff7800"
primary_color_dark_alpha = "rgba(255, 120, 0, 0.2)"
primary_color_dark_alpha = "rgb(255 120 0 / 0.2)"
```
### Favicon

View File

@ -558,9 +558,9 @@ Blah blah <q>Inline Quote</q> hmm.
b = parseInt(hex.slice(5, 7), 16);
if (alpha) {
return "rgba(" + r + ", " + g + ", " + b + ", " + alpha + ")";
return "rgb(" + r + " " + g + " " + b + " / " + alpha + ")";
} else {
return "rgb(" + r + ", " + g + ", " + b + ")";
return "rgb(" + r + " " + g + " " + b + ")";
}
}

View File

@ -32,7 +32,7 @@ You can make navbar have more classic look:
#site-nav {
top: 0;
margin-top: 0;
box-shadow: 0 0.75rem 1.5rem -1rem rgba(0, 0, 0, 0.5);
box-shadow: 0 0.75rem 1.5rem -1rem rgb(0 0 0 / 0.5);
border-radius: 0;
width: 100%;
max-width: 100%;
@ -69,7 +69,7 @@ Or you can make it sticked to top but not full-width:
#site-nav {
top: 0;
margin-top: 0;
box-shadow: 0 0.75rem 1.5rem -1rem rgba(0, 0, 0, 0.5);
box-shadow: 0 0.75rem 1.5rem -1rem rgb(0 0 0 / 0.5);
border-radius: 0 0 calc(var(--rounded-corner) + 0.5rem) calc(var(--rounded-corner) + 0.5rem);
nav ul li {
@ -192,10 +192,10 @@ Most of the time contrast should be okay, but what if it's not? Simply adjust th
```scss
:root {
--bg-color: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8));
--bg-color: linear-gradient(rgb(255 255 255 / 0.8), rgb(255 255 255 / 0.8));
@media (prefers-color-scheme: dark) {
--bg-color: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.9));
--bg-color: linear-gradient(rgb(0 0 0 / 0.9), rgb(0 0 0 / 0.9));
}
}
```