Skip to content

Commit a63a028

Browse files
authored
Update sidebar-notice
1 parent 20bd0b1 commit a63a028

File tree

2 files changed

+32
-17
lines changed

2 files changed

+32
-17
lines changed

discord/sidebar-notice/README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
> Displays the notice bar within the sidebar instead of positioning it at the top of the base container.
44
55
### Variables
6-
- `--notice-join` : sets the icon for joining server notice.
7-
- `--notice-welcome`: sets the icon for welcome notice.
6+
- `--notice-margin-top: 48px;` : sets the top margin of the notice panel.
7+
- `--notice-margin-left: 0px;` : sets the left margin of the notice panel.
8+
- `--notice-margin-bottom: auto;` : adjusts the bottom margin of the notice panel.
9+
- `--notice-margin-right: auto;` : adjusts the right margin of the notice panel.
10+
11+
- `--notice-enable-height-adjust: true;` : enables height adjustment for the notice panel.
12+
- `--notice-icon-join: transparent;` : sets the join icon.
13+
- `--notice-icon-welcome: url("https://discord.com/assets/7f809e89e310c87b2e3f.svg");` : sets the welcome icon.
814

915
### Preview

discord/sidebar-notice/import.css

+24-15
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
:root {
22
/* root variables */
3-
--notice-height: 0px;
4-
--notice-join: transparent;
5-
--notice-welcome: url("https://discord.com/assets/7f809e89e310c87b2e3f.svg");
3+
--notice-margin-top: 48px;
4+
--notice-margin-bottom: auto;
5+
--notice-margin-left: 0px;
6+
--notice-margin-right: auto;
7+
8+
--notice-enable-height-adjust: true;
9+
--notice-icon-join: transparent;
10+
--notice-icon-welcome: url("https://discord.com/assets/7f809e89e310c87b2e3f.svg");
611
}
712

8-
.base_a4d4d9:has([class*="notice_"]) {
13+
.base_a4d4d9:has(.notice_be03aa) {
914

1015
&:has(.notice_dd5a33) {
1116
--notice-height: 140px;
@@ -17,23 +22,25 @@
1722
--notice-icon: var(--notice-welcome);
1823
}
1924

20-
>div[class*="notice_"] {
25+
>div.notice_be03aa {
2126
align-content: space-between;
2227
background: var(--background-secondary);
2328
border-bottom: 1px solid var(--background-secondary);
2429
border-radius: 0;
30+
bottom: var(--notice-margin-bottom);
2531
box-shadow: none;
2632
box-sizing: border-box;
2733
display: grid;
2834
gap: 12px 8px;
2935
grid-template-columns: 80px 1fr;
3036
grid-template-rows: auto 32px;
3137
height: var(--notice-height);
32-
left: 0;
38+
left: var(--notice-margin-left);
3339
overflow: hidden;
3440
padding: 16px 0;
3541
position: absolute;
36-
top: 48px;
42+
right: var(--notice-margin-right);
43+
top: var(--notice-margin-top);
3744
width: 240px;
3845

3946
&:before {
@@ -189,7 +196,7 @@
189196
}
190197
}
191198

192-
[class="header_fd6364"] {
199+
.header_fd6364 {
193200
background: var(--background-secondary);
194201
box-shadow: none;
195202
}
@@ -202,13 +209,15 @@
202209
width: 100%;
203210
}
204211

205-
.thin_eed6a8>ul {
206-
&:has(> div[style="height: 16px;"]) {
207-
margin-top: -17px;
208-
}
212+
@container(style(--notice-enable-height-adjust: true)) {
213+
.thin_eed6a8>ul {
214+
&:has(> div[style="height: 16px;"]) {
215+
margin-top: -17px;
216+
}
209217

210-
&:has(> div[style="height: 84px;"]) {
211-
margin-top: -85px;
218+
&:has(> div[style="height: 84px;"]) {
219+
margin-top: -85px;
220+
}
212221
}
213222
}
214-
}
223+
}

0 commit comments

Comments
 (0)