docs/.vitepress/theme/styles/steps.css

b0e45178e98dcdfe343a9610a8e87bd419c93b5b
wotaku/docs/.vitepress/theme/styles/steps.css history · blame · raw

82 lines · 2204 bytes

 1:root {
 2  --steps-start: 0;
 3  --steps-line-height: 1.75;
 4  --steps-line-height-headings: 1.2;
 5  --steps-text-xs: 0.8125rem;
 6  --steps-color-white: hsl(0, 0%, 100%);
 7  --steps-color-gray-one: hsl(224, 10%, 23%);
 8  --steps-color-gray-two: hsl(224, 14%, 16%);
 9  --steps-color-hairline-light: var(--steps-color-gray-one);
10}
11
12html:not(.dark) {
13  --steps-color-white: hsl(224, 10%, 10%);
14  --steps-color-gray-one: hsl(224, 6%, 77%);
15  --steps-color-gray-two: hsl(224, 20%, 94%);
16  --steps-color-hairline-light: var(--steps-color-gray-two);
17}
18
19.steps ol {
20  --bullet-size: calc(var(--steps-line-height) * 1rem);
21  --bullet-margin: 0.375rem;
22  list-style: none;
23  counter-reset: steps-counter var(--steps-start);
24  padding-inline-start: 0;
25}
26
27.steps ol > li {
28  counter-increment: steps-counter;
29  position: relative;
30  padding-inline-start: calc(var(--bullet-size) + 1rem);
31  padding-bottom: 1px;
32  min-height: calc(var(--bullet-size) + var(--bullet-margin));
33}
34
35.steps ol > li + li {
36  margin-top: 0;
37}
38
39.steps ol > li::before {
40  content: counter(steps-counter);
41  position: absolute;
42  top: 0;
43  inset-inline-start: 0;
44  width: var(--bullet-size);
45  height: var(--bullet-size);
46  line-height: var(--bullet-size);
47  font-size: var(--steps-text-xs);
48  font-weight: 600;
49  text-align: center;
50  color: var(--steps-color-white);
51  background-color: var(--steps-color-gray-two);
52  border-radius: 99rem;
53  box-shadow: inset 0 0 0 1px var(--steps-color-gray-one);
54}
55
56.steps ol > li::after {
57  --guide-width: 1px;
58  content: "";
59  position: absolute;
60  top: calc(var(--bullet-size) + var(--bullet-margin));
61  bottom: var(--bullet-margin);
62  inset-inline-start: calc((var(--bullet-size) - var(--guide-width)) / 2);
63  width: var(--guide-width);
64  background-color: var(--steps-color-hairline-light);
65}
66
67.steps ol > li > :first-child {
68  --lh: calc(1em * var(--steps-line-height));
69  --shift-y: calc(0.5 * (var(--bullet-size) - var(--lh)));
70  transform: translateY(var(--shift-y));
71  margin-bottom: var(--shift-y);
72}
73
74.steps ol > li > :first-child:where(h1, h2, h3, h4, h5, h6) {
75  --lh: calc(1em * var(--steps-line-height-headings));
76}
77
78@supports (--prop: 1lh) {
79  .steps ol > li > :first-child {
80    --lh: 1lh;
81  }
82}