Skip to content

Commit 5e4dffa

Browse files
committed
list gutenberg
1 parent 4db4a32 commit 5e4dffa

File tree

1 file changed

+113
-21
lines changed

1 file changed

+113
-21
lines changed

src/scss/06-blocks/core/_list.scss

Lines changed: 113 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,127 @@
1+
%bullet {
2+
position: absolute;
3+
top: 12px;
4+
left: 0;
5+
width: 5px;
6+
height: 5px;
7+
content: "";
8+
background-color: $color-dark;
9+
border-radius: 100%;
10+
11+
@include rtl {
12+
right: -15px;
13+
left: inherit;
14+
}
15+
}
16+
117
#{context-selector('.blocks-container', '.is-root-container')} {
2-
ul,
3-
ol {
4-
// Utility classes
5-
&.aligncenter {
6-
padding: 0;
7-
list-style-position: inside;
8-
}
18+
ul:not(.not-custom-list),
19+
ol:not(.not-custom-list) {
20+
&:not([class*="is-style-"]):not([class*="no-list-style"]):not([role="list"]) {
21+
font-size: var(--paragraph--font-size-default, $font-size-base);
22+
line-height: var(--paragraph--line-height-default, $line-height-base);
923

10-
&.alignright {
11-
padding: 0;
12-
text-align: right;
13-
list-style-position: inside;
24+
ul,
25+
ol {
26+
margin-top: var(--spacing--block-1);
27+
margin-bottom: var(--spacing--block-1);
28+
}
1429
}
1530
}
1631

17-
ul {
18-
&:not([class*="is-style-"], .no-list-style) {
19-
list-style-type: disc;
32+
ul:not(.not-custom-list) {
33+
&:not([class*="is-style-"], .no-list-style,[role="list"]) {
34+
list-style-type: none;
35+
36+
li {
37+
position: relative;
38+
padding-left: 30px;
39+
margin-bottom: calc(.5 * var(--spacing--block-1));
40+
41+
@include rtl {
42+
padding-right: 30px;
43+
padding-left: 0;
44+
}
45+
46+
&::before {
47+
@extend %bullet;
48+
}
49+
}
2050

21-
li::marker {
22-
color: $color-primary;
51+
ul {
52+
margin-top: calc(.5 * var(--spacing--block-1));
53+
margin-bottom: calc(.5 * var(--spacing--block-1));
2354
}
2455
}
2556
}
2657

27-
ol {
28-
&:not([class*="is-style-"]) {
29-
list-style-type: decimal;
58+
ol:not(.not-custom-list) {
59+
&:not([class*="is-style-"], .no-list-style,[role="list"]) {
60+
list-style: none;
61+
counter-reset: section;
62+
63+
&:not([class*="is-style-"]) {
64+
li {
65+
position: relative;
66+
padding-left: 30px;
67+
margin-bottom: calc(.5 * var(--spacing--block-1));
68+
counter-increment: section;
69+
70+
@include rtl {
71+
padding-right: 30px;
72+
padding-left: 0;
73+
}
74+
75+
&::before {
76+
position: absolute;
77+
top: 0;
78+
left: 0;
79+
font-family: $font-family-secondary;
80+
font-size: var(--paragraph--font-size-default, $font-size-base);
81+
font-weight: 400;
82+
line-height: var(--paragraph--line-height-default, $line-height-base);
83+
color: $color-dark;
84+
text-align: center;
85+
letter-spacing: -.06em;
86+
content: counters(section, "", decimal-leading-zero) " ";
87+
88+
@include rtl {
89+
right: 0;
90+
left: inherit;
91+
transform: translateX(100%);
92+
}
93+
}
94+
95+
ol {
96+
margin-top: calc(.5 * var(--spacing--block-1));
97+
margin-bottom: calc(.5 * var(--spacing--block-1));
98+
counter-reset: subsection;
99+
100+
li {
101+
counter-increment: subsection;
102+
103+
&::before {
104+
content: counters(subsection, ".", lower-alpha) ". ";
105+
}
106+
}
107+
}
108+
109+
ul {
110+
margin-top: calc(.5 * var(--spacing--block-1));
111+
margin-bottom: calc(.5 * var(--spacing--block-1));
112+
counter-reset: section;
113+
114+
li {
115+
padding-top: 0;
116+
117+
&::before {
118+
@extend %bullet;
119+
transform: translateX(0);
120+
}
121+
}
122+
}
30123

31-
li::marker {
32-
color: $color-primary;
124+
}
33125
}
34126
}
35127
}

0 commit comments

Comments
 (0)