Skip to content

Commit 19b6906

Browse files
authored
Merge pull request #367 from BeAPI/feature/list
list gutenberg
2 parents 4db4a32 + d258056 commit 19b6906

File tree

2 files changed

+99
-17
lines changed

2 files changed

+99
-17
lines changed

src/scss/03-base/_variables-css.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
*/
5959
--wp-admin-bar-height: var(--wp-admin--admin-bar--height, 0rem);
6060

61+
body:not(.admin-bar) {
62+
--wp-admin-bar-height: 0rem; // for wp admin bar hider extension
63+
}
64+
6165
/*
6266
* Alignments breakpoints
6367
*/

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

Lines changed: 95 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,113 @@
1+
// Use the no-list-style class in your theme if you want the basic style
2+
3+
%marker-ol-default {
4+
font-size: 16px;
5+
font-weight: 700;
6+
line-height: 1.3;
7+
color: $color-dark;
8+
}
9+
10+
%marker-ul-default {
11+
position: absolute;
12+
top: 7px;
13+
left: 0;
14+
width: 6px;
15+
height: 6px;
16+
content: "";
17+
background-color: $color-dark;
18+
border-radius: 100%;
19+
20+
@include rtl {
21+
right: -15px;
22+
left: inherit;
23+
}
24+
}
25+
126
#{context-selector('.blocks-container', '.is-root-container')} {
27+
--offset-item: 30px;
28+
--vertical-spaging-item: 16px;
29+
230
ul,
331
ol {
4-
// Utility classes
5-
&.aligncenter {
6-
padding: 0;
7-
list-style-position: inside;
8-
}
32+
&:not([class*="no-list-style"]):not([role="list"]):not(.chosen-choices):not(.chosen-results) {
33+
font-size: var(--paragraph--font-size-default, $font-size-base);
34+
line-height: var(--paragraph--line-height-default, $line-height-base);
935

10-
&.alignright {
11-
padding: 0;
12-
text-align: right;
13-
list-style-position: inside;
36+
ul,
37+
ol {
38+
margin-top: var(--vertical-spaging-item);
39+
margin-bottom: var(--vertical-spaging-item);
40+
}
1441
}
1542
}
1643

1744
ul {
18-
&:not([class*="is-style-"], .no-list-style) {
19-
list-style-type: disc;
45+
&:not([class*="no-list-style"]):not([role="list"]):not(.chosen-choices):not(.chosen-results) {
46+
list-style-type: none;
47+
48+
li {
49+
position: relative;
50+
padding-left: var(--offset-item);
51+
margin-bottom: var(--vertical-spaging-item);
2052

21-
li::marker {
22-
color: $color-primary;
53+
@include rtl {
54+
padding-right: var(--offset-item);
55+
padding-left: 0;
56+
}
57+
58+
&::before {
59+
@extend %marker-ul-default;
60+
}
61+
}
62+
63+
ul {
64+
margin-top: var(--vertical-spaging-item);
65+
margin-bottom: var(--vertical-spaging-item);
2366
}
2467
}
2568
}
2669

2770
ol {
28-
&:not([class*="is-style-"]) {
29-
list-style-type: decimal;
71+
padding-left: 10px;
72+
73+
&:not([class*="no-list-style"]):not([role="list"]) {
74+
> li {
75+
padding-left: calc(var(--offset-item) * .5);
76+
margin-bottom: var(--vertical-spaging-item);
77+
margin-left: calc(var(--offset-item) * .5);
78+
79+
@include rtl {
80+
padding-right: calc(var(--offset-item) * .5);
81+
padding-left: 0;
82+
margin-right: calc(var(--offset-item) * .5);
83+
margin-left: 0;
84+
}
85+
}
86+
87+
li {
88+
&::marker {
89+
@extend %marker-ol-default;
90+
}
91+
92+
ol {
93+
margin-top: var(--vertical-spaging-item);
94+
margin-bottom: var(--vertical-spaging-item);
95+
}
96+
97+
ul {
98+
margin-top: var(--vertical-spaging-item);
99+
margin-bottom: var(--vertical-spaging-item);
100+
101+
li {
102+
padding-top: 0;
103+
104+
&::before {
105+
@extend %marker-ul-default;
106+
transform: translateX(0);
107+
}
108+
}
109+
}
30110

31-
li::marker {
32-
color: $color-primary;
33111
}
34112
}
35113
}

0 commit comments

Comments
 (0)