Skip to content

Commit b48734f

Browse files
committed
update Theme.md
Signed-off-by: Dev4Mod <[email protected]>
1 parent 518593e commit b48734f

File tree

1 file changed

+81
-54
lines changed

1 file changed

+81
-54
lines changed

Theme.md

Lines changed: 81 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,29 @@ want to modify.
1010

1111
## Defining Properties
1212

13-
You can define various properties for interface elements. Here are some of the properties you can
14-
use:
13+
You can define various properties for interface elements. Here are the properties you can use:
1514

1615
- **color**: Defines the color of the text or element.
17-
- **background-image**: Defines the background image.
18-
- **alpha**: Defines the opacity of the element.
19-
- **color-tint**: Applies a color over an image.
20-
- **color-filter**: Applies a color filter to the element.
21-
- **display**: Defines the display of the element (use `none` to hide).
22-
23-
## Example of Custom CSS
16+
- **background-color**: Changes the background color. Can use format
17+
`background-color: #original #replacement` to replace specific colors.
18+
- **background-image**: Defines the background image, use `url('filename.png')`.
19+
- **background-size**: Controls the size of background images. Can use specific values, percentages,
20+
or `cover`.
21+
- **background**: Shorthand property for background settings. Supports colors, images and linear
22+
gradients.
23+
- **foreground**: Sets the foreground drawable, supports colors and images.
24+
- **alpha**: Defines the opacity of the element (0.0 to 1.0).
25+
- **display**: Controls visibility (`none` to hide, `block` to show, `invisible` for invisible but
26+
taking space).
27+
- **font-size**: Sets the text size for TextView elements.
28+
- **width/height**: Sets element dimensions, supports pixels and percentage values.
29+
- **left/right/top/bottom**: Sets element positioning within its parent container.
30+
- **color-filter**: Applies a color filter to the element. Format: `color-filter: MODE #COLOR` (
31+
e.g., `SRC_ATOP #FF0000`).
32+
- **color-tint**: Applies a color tint to the element. Use `none` to remove.
33+
- **parent**: Changes the parent container of an element.
34+
35+
## Advanced Example of Custom CSS
2436

2537
```css
2638
/*
@@ -31,71 +43,86 @@ wallpaper_alpha_navigation = 75
3143
wallpaper_alpha_toolbar = 60
3244
3345
change_colors = true
34-
primary_color = #ff0000
35-
secondary_color = 0
46+
primary_color = color_system_accent1_300
47+
secondary_color = color_system_accent2_500
3648
background_color = #151515
3749
3850
bubble_colors = true
3951
bubble_right = #a00000
4052
bubble_left = #0000a0
53+
54+
change_dpi = 420
4155
*/
4256

43-
#elementID {
57+
/* Target specific class with ID */
58+
.com.whatsapp.HomeActivity #conversations_row_contact_name {
4459
color: #FFFFFF;
60+
font-size: 16px;
61+
}
62+
63+
/* Simple element styling by ID */
64+
#elementID {
4565
background-image: url('background.png');
66+
background-size: 100% 100%;
4667
alpha: 0.8;
47-
color-tint: rgba(255, 0, 0, 0.5);
48-
color-filter: grayscale(100%);
68+
display: block;
69+
}
70+
71+
/* Element with color tinting */
72+
#imageView {
73+
color-tint: #FF0000 #00FF00 #0000FF; /* normal, pressed, disabled states */
74+
}
75+
76+
/* Element with positioning */
77+
#bottomElement {
78+
width: 100%;
79+
height: 60px;
80+
bottom: 0px;
81+
}
82+
83+
/* Using linear gradient background */
84+
#gradientElement {
85+
background: linear-gradient(45deg, #FF0000 0%, #00FF00 50%, #0000FF 100%);
86+
}
87+
88+
/* Replace specific background colors */
89+
#coloredElement {
90+
background-color: #123456 #654321; /* replace #123456 with #654321 */
91+
}
92+
93+
/* Hiding elements */
94+
#unwantedElement {
4995
display: none;
5096
}
5197
```
5298

53-
### Explanation of the Example
54-
55-
- **Initial Comment**: The comment at the beginning of the CSS is used to define various settings.
56-
- `wallpaper = false`: Disables the use of a wallpaper.
57-
- `wallpaper_file = "wall.png"`: Defines the wallpaper image file.
58-
- `wallpaper_alpha = 60`: Defines the opacity of the wallpaper.
59-
- `wallpaper_alpha_navigation = 75`: Defines the opacity of the wallpaper in the navigation bar.
60-
- `wallpaper_alpha_toolbar = 60`: Defines the opacity of the wallpaper in the toolbar.
61-
- `change_colors = true`: Enables color changes.
62-
- `primary_color = color_system_accent1_300`: Defines the primary color.
63-
- `secondary_color = color_system_accent2_500`: Defines the secondary color.
64-
- `background_color = color_system_accent2_900`: Defines the background color.
65-
- `bubble_colors = true`: Enables color changes for bubbles.
66-
- `bubble_right = color_system_accent1_500`: Defines the color of the right bubble.
67-
- `bubble_left = color_system_accent3_500`: Defines the color of the left bubble.
68-
69-
### Using Material You Colors
70-
71-
To use the Material You colors defined by Android, you can use the prefix `color_` followed by the
72-
name of the Material You ID. For example:
99+
## Using Material You Colors
73100

74-
- `primary_color = color_system_accent1_300`
75-
- `secondary_color = color_system_accent2_500`
76-
- `background_color = color_system_accent2_900`
77-
- `bubble_right = color_system_accent1_500`
78-
- `bubble_left = color_system_accent3_500`
101+
To use the Material You colors defined by Android, you can use the prefix color_ followed by the
102+
name of the Material You ID. For example:
79103

80-
### Example with Material You Colors
104+
* primary_color = color_system_accent1_300
105+
* secondary_color = color_system_accent2_500
106+
* background_color = color_system_accent2_900
107+
* bubble_right = color_system_accent1_500
108+
* bubble_left = color_system_accent3_500
81109

82-
```css
83-
/*
84-
wallpaper = false
85-
wallpaper_file = "wall.png"
86-
wallpaper_alpha = 60
87-
wallpaper_alpha_navigation = 75
88-
wallpaper_alpha_toolbar = 60
110+
## Setting Custom DPI
89111

90-
change_colors = true
91-
primary_color = color_system_accent1_300
92-
secondary_color = color_system_accent2_500
93-
background_color = color_system_accent2_900
112+
You can set a custom DPI value to adjust the scaling of the entire UI:
94113

95-
bubble_colors = true
96-
bubble_right = color_system_accent1_500
97-
bubble_left = color_system_accent3_500
114+
```
115+
/*
116+
change_dpi = 420
98117
*/
99118
```
100119

120+
## CSS Selectors
121+
122+
You can target elements using different selectors:
123+
124+
* Direct ID targeting: #elementID
125+
* Class with ID targeting: com.whatsapp.ClassName #elementID
126+
* Element type with attributes: TextView:nth-child(1) or ImageView:contains(text)
127+
101128
Follow these instructions to customize the appearance of your application as needed.

0 commit comments

Comments
 (0)