@allxsmith/bestax-bulma 5.50.0 → 5.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,153 @@
1
+ // Bestax Extras - DescriptionList Styles
2
+ // Facts about one thing, each a label and its value: a `<dl>` with a `<div>`
3
+ // per item, a `<dt>` per label and a `<dd>` per value. Bulma styles a `<dl>`
4
+ // only inside `.content`, where it indents the values, so this lays one out.
5
+ //
6
+ // The list is a grid, and each item spans it on `subgrid`, so every label
7
+ // sits in the first column and every value in the last. Stacked, the grid
8
+ // has one column; beside, it has two, the labels' as wide as the longest
9
+ // label. The columns are all an orientation changes. The grid follows the
10
+ // writing direction, so a right-to-left page needs no rules of its own, and
11
+ // the gaps are in em, so `textSize` on the list scales them with the text.
12
+
13
+ @use "bulma/sass/utilities/initial-variables" as iv;
14
+ @use "bulma/sass/utilities/css-variables" as cv;
15
+ @use "bulma/sass/utilities/mixins" as mx;
16
+
17
+ // Between items.
18
+ $description-list-gap: 0.75em !default;
19
+ // Between the labels' column and the values', side by side.
20
+ $description-list-column-gap: 1.5em !default;
21
+ // Between a label and its value stacked, and between several labels or
22
+ // several values in one item.
23
+ $description-list-row-gap: 0.25em !default;
24
+ // The most the labels' column takes side by side. Longer labels wrap.
25
+ $description-list-label-max-width: 40% !default;
26
+ $description-list-label-color: cv.getVar("text-weak") !default;
27
+ $description-list-label-weight: cv.getVar("weight-normal") !default;
28
+ $description-list-value-color: cv.getVar("text") !default;
29
+ $description-list-divider-color: cv.getVar("border-weak") !default;
30
+ $description-list-divider-width: 1px !default;
31
+
32
+ .#{iv.$class-prefix}description-list {
33
+ @include cv.register-vars(
34
+ (
35
+ "description-list-gap": #{$description-list-gap},
36
+ "description-list-column-gap": #{$description-list-column-gap},
37
+ "description-list-row-gap": #{$description-list-row-gap},
38
+ "description-list-label-max-width": #{$description-list-label-max-width},
39
+ "description-list-label-color": #{$description-list-label-color},
40
+ "description-list-label-weight": #{$description-list-label-weight},
41
+ "description-list-value-color": #{$description-list-value-color},
42
+ "description-list-divider-color": #{$description-list-divider-color},
43
+ "description-list-divider-width": #{$description-list-divider-width},
44
+ )
45
+ );
46
+ }
47
+
48
+ // ---- The two orientations, as the list's columns ----------------------------
49
+
50
+ @mixin -vertical {
51
+ grid-template-columns: minmax(0, 1fr);
52
+ }
53
+
54
+ @mixin -horizontal {
55
+ grid-template-columns: fit-content(#{cv.getVar("description-list-label-max-width")}) minmax(0, 1fr);
56
+ }
57
+
58
+ // ---- Structure ----------------------------------------------------------------
59
+
60
+ .#{iv.$class-prefix}description-list {
61
+ display: grid;
62
+ @include -vertical;
63
+ column-gap: cv.getVar("description-list-column-gap");
64
+ row-gap: cv.getVar("description-list-gap");
65
+ margin: 0;
66
+ padding: 0;
67
+ // On the root, so a `textColor` helper's class outranks it and the values
68
+ // inherit either.
69
+ color: cv.getVar("description-list-value-color");
70
+
71
+ &:not(:last-child) {
72
+ margin-bottom: cv.getVar("block-spacing");
73
+ }
74
+ }
75
+
76
+ .#{iv.$class-prefix}description-list-item {
77
+ display: grid;
78
+ grid-column: 1 / -1;
79
+ // A browser without `subgrid` keeps this one column, so its items stay
80
+ // stacked at every width rather than misplace a value.
81
+ grid-template-columns: minmax(0, 1fr);
82
+ grid-template-columns: subgrid;
83
+ // Each label from the top of the first column and each value from the top
84
+ // of the last, so several of either line up from the item's first line.
85
+ grid-auto-flow: row dense;
86
+ align-items: baseline;
87
+ row-gap: cv.getVar("description-list-row-gap");
88
+ }
89
+
90
+ // Through the root, so it outranks Bulma's `.content dd` indent.
91
+ .#{iv.$class-prefix}description-list .#{iv.$class-prefix}description-list-label {
92
+ grid-column: 1 / 2;
93
+ margin: 0;
94
+ color: cv.getVar("description-list-label-color");
95
+ font-weight: cv.getVar("description-list-label-weight");
96
+ }
97
+
98
+ .#{iv.$class-prefix}description-list .#{iv.$class-prefix}description-list-value {
99
+ grid-column: -2 / -1;
100
+ margin: 0;
101
+ // An order number, an email or a URL wraps rather than widen the list.
102
+ overflow-wrap: anywhere;
103
+ }
104
+
105
+ .#{iv.$class-prefix}description-list.#{iv.$class-prefix}has-dividers
106
+ > .#{iv.$class-prefix}description-list-item
107
+ + .#{iv.$class-prefix}description-list-item {
108
+ border-block-start: cv.getVar("description-list-divider-width") solid cv.getVar("description-list-divider-color");
109
+ padding-block-start: cv.getVar("description-list-gap");
110
+ }
111
+
112
+ // ---- Orientation ----------------------------------------------------------------
113
+
114
+ // With no orientation given: stacked on a phone, beside from tablet up.
115
+ @include mx.tablet {
116
+ .#{iv.$class-prefix}description-list {
117
+ @include -horizontal;
118
+ }
119
+ }
120
+
121
+ @mixin -orientations($suffix) {
122
+ .#{iv.$class-prefix}description-list.#{iv.$class-prefix}is-vertical#{$suffix} {
123
+ @include -vertical;
124
+ }
125
+
126
+ .#{iv.$class-prefix}description-list.#{iv.$class-prefix}is-horizontal#{$suffix} {
127
+ @include -horizontal;
128
+ }
129
+ }
130
+
131
+ // `orientation` at every width, then each viewport's prop from its own
132
+ // breakpoint, narrowest first, so where several apply the widest one wins.
133
+ @include -orientations("");
134
+
135
+ @include mx.mobile {
136
+ @include -orientations("-mobile");
137
+ }
138
+
139
+ @include mx.tablet {
140
+ @include -orientations("-tablet");
141
+ }
142
+
143
+ @include mx.desktop {
144
+ @include -orientations("-desktop");
145
+ }
146
+
147
+ @include mx.widescreen {
148
+ @include -orientations("-widescreen");
149
+ }
150
+
151
+ @include mx.fullhd {
152
+ @include -orientations("-fullhd");
153
+ }
@@ -2,6 +2,7 @@
2
2
  // Import all element partials here
3
3
 
4
4
  // Element Components
5
+ @use 'descriptionlist';
5
6
  @use 'kbd';
6
7
  @use 'linkbutton';
7
8
  @use 'loader';