Skip to content

Commit b313263

Browse files
bart-krakowskisanscontextimklau
committed
feat(): Add additional styles of ordered lists (#479)
* feat(): Add additional styles of ordered lists * Add more lists examples to the styleguide * fix(markdown): Introduce additional styles to ordered lists Co-authored-by: LRubin <[email protected]> Co-authored-by: Klaudia <[email protected]>
1 parent 8992726 commit b313263

File tree

2 files changed

+136
-16
lines changed

2 files changed

+136
-16
lines changed

src/_sass/components/_markdown.scss

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,28 +158,64 @@
158158
& > ul, ol {
159159
margin-top: 0;
160160
}
161+
}
162+
}
161163

164+
@for $i from 1 through 10 {
165+
ol[start="#{$i}"] {
166+
@if $i > 1 {
167+
counter-reset: section #{$i - 1};
168+
} @else {
169+
counter-reset: section #{$i};
170+
}
162171
}
163172
}
164173

165174
ol {
166175
list-style-type: none;
167-
counter-reset: list-items;
176+
counter-reset: section;
168177
padding-left: 25px;
169178

170-
& > li {
171-
counter-increment: list-items;
179+
&.lower-roman {
180+
li {
181+
&::before {
182+
content: counters(section, ".", lower-roman) ". ";
183+
}
184+
}
185+
}
186+
187+
&.upper-roman {
188+
li {
189+
&::before {
190+
content: counters(section, ".", upper-roman) ". ";
191+
}
192+
}
193+
}
194+
195+
&.lower-alpha {
196+
li {
197+
&::before {
198+
content: counters(section, ".", lower-alpha) ". ";
199+
}
200+
}
201+
}
202+
203+
&.upper-alpha {
204+
li {
205+
&::before {
206+
content: counters(section, ".", upper-alpha) ". ";
207+
}
208+
}
209+
}
210+
211+
li {
172212
line-height: 30px;
173-
position: relative;
174213

175214
&::before {
176-
content: counter(list-items) ". ";
177-
display: block;
178-
top: 0;
215+
counter-increment: section;
216+
content: counters(section, ".") ". ";
179217
color: color(primary-dark);
180218
font-weight: 500;
181-
position: absolute;
182-
left: -20px;
183219
}
184220

185221
& > ul, ol {
@@ -188,6 +224,10 @@
188224
}
189225
}
190226

227+
& > ol {
228+
padding-left: 0;
229+
}
230+
191231
table {
192232
border-collapse: collapse;
193233
text-align: left;

src/styleguide.md

Lines changed: 87 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,100 @@ related:
3131

3232
## Lists
3333

34-
1. one
35-
1. nested
36-
2. two
37-
1. nested
38-
3. three
39-
1. nested
34+
#### unordered
4035

4136
* Item
4237
* First Subitem
4338
* Second Subitem
4439
* Item
4540
- Subitem
4641
- Subitem
47-
* Item
42+
43+
#### ordered
44+
45+
1. one
46+
2. two
47+
3. three
48+
49+
50+
#### nested ordered
51+
52+
1. one
53+
1. nested
54+
2. nested
55+
2. two
56+
1. nested
57+
2. nested
58+
3. three
59+
1. nested
60+
2. nested
61+
3. more nested
62+
4. more nested
63+
64+
65+
#### ordered with start number = 6
66+
67+
{: start="6"}
68+
1. lorem
69+
2. ipsum
70+
3. ipsum
71+
72+
#### lower roman
73+
74+
{:.lower-roman}
75+
1. lorem
76+
2. ipsum
77+
3. nested
78+
4. nested
79+
80+
#### upper roman
81+
82+
{:.upper-roman}
83+
1. lorem
84+
2. ipsum
85+
86+
#### lower alpha
87+
88+
{:.lower-alpha}
89+
1. lorem
90+
2. lorem nested
91+
3. lorem nested
92+
2. ipsum
93+
3. ipsum nested
94+
4. ipsum nested
95+
5. ipsum nested
96+
5. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
97+
6. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.
98+
99+
#### upper alpha
100+
101+
{:.upper-alpha}
102+
1. lorem
103+
2. ipsum
104+
3. nested
105+
4. nested
106+
107+
### 2. Definitions
108+
109+
For purposes of this Addendum, the terms below have the meanings set
110+
forth below. Capitalized terms that are used but not defined in this
111+
Addendum have the meanings given in the Agreement.
112+
113+
{: start="2"}
114+
1. "**Affiliate**" means any entity that directly or indirectly controls, is controlled by or is under common control with the subject entity, where "control" refers to the power to direct or cause the direction of the subject entity, whether through ownership of voting securities, by contract or otherwise.
115+
2. "**CCPA**" means the California Consumer Privacy Act of 2018, as amended from time to time.
116+
3. "**Customer Personal Data**" means any Customer Data (as defined in theAgreement) that is Personal Data. For purposes of this Addendum, Customer Personal Data does not include personal information of employees or other representatives of Customer with whom Segment has a direct business relationship.
117+
4. "**Data Protection Laws**" means, with respect to a party, all privacy,data protection and information security-related laws and regulations applicable to such party's Processing of Personal Data, including, where applicable, EU Data Protection Law and the CCPA.
118+
5. Lorem
119+
6. ipsum
120+
121+
### 3. General Termination
122+
123+
{:.lower-alpha}
124+
1. This Addendum forms part of the Agreement and except as expressly set forth in this Addendum, the Agreement remains unchanged and in full force and effect. If there is any conflict between this Addendum and the Agreement, this Addendum shall govern.
125+
2. Any liabilities arising under this Addendum are subject to the limitations of liability in the Agreement.
126+
3. This Addendum will be governed by and construed in accordance with governing law and jurisdiction provisions in the Agreement, unless required otherwise by applicable Data Protection Laws.
127+
4. This Addendum will automatically terminate upon expiration or termination of the Agreement.
48128

49129
{% include components/list-steps.html number="1" heading="Totally new here?" content="Not sure what to track or why? Check out Segment's Analytics Academy to learn more about the wide world of analytics, including the what and why and some stories about beautiful stacks." %}
50130
{% include components/list-steps.html number="2" heading="Totally new here?" content="Not sure what to track or why? Check out Segment's Analytics Academy to learn more about the wide world of analytics, including the what and why and some stories about beautiful stacks." %}

0 commit comments

Comments
 (0)