Skip to content

Commit 0fab652

Browse files
committed
chore: make theming and ui docs a little nicer
1 parent 72f18bb commit 0fab652

4 files changed

Lines changed: 33 additions & 30 deletions

File tree

docs/library/library.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 3.5
2+
sidebar_position: 4
33
---
44

55
# Library

docs/theming_and_ui/styling_widgets.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,7 @@ When creating your ewwii config, always make sure to add this at the top of your
1212

1313
It gets rid of the Gtk theming and allows you to style your own widgets.
1414

15-
## In-Line
16-
17-
Ewwii allows writing inline styles to widgets using the `style` property. These styles are then applied at runtime using GTK's CSS system.
18-
19-
**Example:**
20-
21-
```nbcl
22-
# This example makes the text color of all child
23-
# widgets of box to black and sets the background
24-
# color of the box to white
25-
# (`#fff` is the hexadecimal for white).
26-
27-
Box {
28-
style = "color: black; background-color: #fff;"
29-
30-
Label {
31-
text = "baz"
32-
}
33-
}
34-
```
35-
36-
## (S)CSS
15+
## Styling in SCSS/CSS
3716

3817
To style a widget in (s)css, you can give that widget a class and access it using its class in (s)css.
3918

@@ -55,3 +34,28 @@ This box is given the class `my-box`, and it can be accessed like so in (s)css:
5534
background-color: white;
5635
}
5736
```
37+
38+
- You can read a bit more about Gtk Theming in [Working With GTK](./working_with_gtk#gtk-theming).
39+
- Or see [GTK CSS Properties Overview wiki](https://docs.gtk.org/gtk4/css-properties.html) directly.
40+
41+
## Recommended Practice
42+
43+
It is recommended to use variables to set styling of components. It is highly reusable and will give you an easier time.
44+
45+
```css
46+
/* Example */
47+
:root {
48+
--bg-surface: #1e1e2e;
49+
--bg-card: #252538;
50+
--border-color: #111111;
51+
--fg-bright: #cdd6f4;
52+
--fg-default: #a6adc8;
53+
--fg-muted: #bac2de;
54+
--accent: #cba6f7;
55+
--critical: #f38ba8;
56+
--success: #a6e3a1;
57+
}
58+
```
59+
60+
Following the same naming is also recommended (optional) as Ewwii plugins related with CSS are likely to follow
61+
the same naming convention.

docs/theming_and_ui/theming_and_ui.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 4
2+
sidebar_position: 3.5
33
---
44

55
# Theming & UI

docs/theming_and_ui/working_with_gtk.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
## Gtk Theming
44

5-
Ewwii is styled in GTK CSS.
5+
As mentioned in [Styling Widgets](./styling_widgets#styling-in-scsscss), ewwii is styled in GTK CSS.
66
You can use `Vanilla CSS` or `SCSS` to make theming even easier. The latter is compiled into CSS for you.
7-
If you don't know any way to style something check out the [GTK CSS Overview wiki](https://docs.gtk.org/gtk3/css-overview.html),
8-
the [GTK CSS Properties Overview wiki ](https://docs.gtk.org/gtk3/css-properties.html),
7+
If you don't know any way to style something check out the
8+
[GTK CSS Properties Overview wiki](https://docs.gtk.org/gtk4/css-properties.html),
99
or use the [GTK-Debugger](#gtk-debugger).
1010

11-
If you have **NO** clue about how to do CSS, check out some online guides or tutorials.
12-
13-
SCSS is _very_ close to CSS, so if you know CSS you'll have no problem learning SCSS.
11+
- If you have **NO** clue about how to do CSS, check out some online guides or tutorials.
12+
- SCSS is _very_ close to CSS, so if you know CSS you'll have no problem learning SCSS.
1413

1514
## GTK Debugger
1615

0 commit comments

Comments
 (0)