Repository navigation
Expand file tree
/
Copy pathbackground.css
More file actions
84 lines (75 loc) · 2.15 KB
/
Copy pathbackground.css
File metadata and controls
84 lines (75 loc) · 2.15 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/**
* @name RolesBackground
* @author Wolfÿ
* @version 1.2
* @description Fills the roles on a user profile with their role color
* @invite avia
* @source https://github.com/MEWPASCO/rainbowglow-avatars
* @website https://www.avariaxyz.win/
*/
:root {
--opacity-role-design: 0.5; /* Use decimal (1 = 100%) for better compatibility */
}
/*
* Discord class names carry a build hash (e.g. role_af3987) that changes with
* updates, so everything below matches on the stable part before the hash.
*/
/* === Base Role Pill === */
:is([class^="role_"], [class*=" role_"]) {
transform: none;
border: none;
border-radius: 5px;
position: relative;
overflow: visible;
padding: 2px 6px;
}
/* === Remove Icon === */
:is([class^="role_"], [class*=" role_"]) [class*="roleRemoveIcon_"] {
left: 18px;
transform: translate(-50%, -50%);
margin: 0;
}
/* === Reset Remove Button Position === */
:is([class^="role_"], [class*=" role_"]) [class*="roleRemoveButton_"] {
position: static;
}
/* === Background Styling Layer === */
:is([class^="role_"], [class*=" role_"]) [class*="roleCircle_"]::before {
content: '';
position: absolute;
inset: 0;
background: inherit;
border-radius: 5px;
box-sizing: border-box;
opacity: var(--opacity-role-design);
pointer-events: none;
}
/* === Text Contrast Fix (dark themes only, light themes keep Discord's text color) === */
.theme-dark [class*="roleName_"] {
color: hsl(0, 0%, 95%) !important;
position: relative;
z-index: 1;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
/* === Base Role Pill inside Adding Role Menu === */
[class*="listBoxItemContent_"] {
transform: none;
border: none;
border-radius: 5px;
position: relative;
overflow: visible;
padding: 2px 6px;
}
/* === Background Styling Layer inside Adding Role Menu ===
NOTE: the space before ::before means "::before of every descendant".
Kept as in v1.1; if it works, narrow it to the specific child element. */
[class*="listBoxItemContent_"] ::before {
content: '';
position: absolute;
inset: 0;
background: inherit;
border-radius: 5px;
box-sizing: border-box;
opacity: var(--opacity-role-design);
pointer-events: none;
}