@ieeesa-npm/shared-styles 0.7.1 → 0.7.3
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.
- package/package.json +1 -1
- package/styles/mixins.scss +96 -0
package/package.json
CHANGED
package/styles/mixins.scss
CHANGED
|
@@ -110,3 +110,99 @@
|
|
|
110
110
|
border-right: $right;
|
|
111
111
|
border-left: $left;
|
|
112
112
|
}
|
|
113
|
+
|
|
114
|
+
// ── Create / edit form shells ────────────────────────────────────────────────
|
|
115
|
+
//
|
|
116
|
+
// A create/edit form has a fixed set of fields. It does not grow with data, so
|
|
117
|
+
// it is sized to its content and the page is the single scroll surface. Its
|
|
118
|
+
// navigation chrome (tab strip / stepper header) and action bar are pinned
|
|
119
|
+
// instead, which keeps them reachable without shrinking the field area.
|
|
120
|
+
//
|
|
121
|
+
// Capping these shells to a slice of the viewport was tried and rejected: it
|
|
122
|
+
// left the field area as short as ~167px on a 1366x600 screen (about one field
|
|
123
|
+
// out of ~25), produced a page scrollbar alongside the inner one, and detached
|
|
124
|
+
// open Material dropdown panels from fields that had scrolled out of the pane.
|
|
125
|
+
// Regions that DO grow with data are bounded individually — see
|
|
126
|
+
// `bounded-record-region`.
|
|
127
|
+
@mixin create-form-dynamic-shell() {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
max-height: none;
|
|
131
|
+
min-height: 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Field area of a dynamic-height form. Grows to fit its fields and never
|
|
135
|
+
// introduces its own scrollbar.
|
|
136
|
+
@mixin create-form-dynamic-surface() {
|
|
137
|
+
flex: 0 0 auto;
|
|
138
|
+
min-height: 0;
|
|
139
|
+
overflow: visible;
|
|
140
|
+
background: none;
|
|
141
|
+
background-color: $ieeesa-white;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// ── Sticky form chrome ───────────────────────────────────────────────────────
|
|
145
|
+
|
|
146
|
+
// Pins a form's navigation chrome (tab strip or stepper header) to the top of
|
|
147
|
+
// the viewport while long content scrolls underneath.
|
|
148
|
+
//
|
|
149
|
+
// The host app publishes the heights of anything already pinned above the routed
|
|
150
|
+
// content, and this chrome stacks below the total:
|
|
151
|
+
// --ieeesa-sticky-header-offset the fixed global header
|
|
152
|
+
// --ieeesa-sticky-subheader-offset a pinned breadcrumb / sub-header, if any
|
|
153
|
+
// Both are live measurements, so chrome that wraps taller on narrow screens is
|
|
154
|
+
// followed automatically, and both resolve to 0 when the host pins nothing —
|
|
155
|
+
// which is why these are additive rather than a single value.
|
|
156
|
+
@mixin sticky-form-nav() {
|
|
157
|
+
position: sticky;
|
|
158
|
+
top: calc(
|
|
159
|
+
var(--ieeesa-sticky-header-offset, 0px) +
|
|
160
|
+
var(--ieeesa-sticky-subheader-offset, 0px)
|
|
161
|
+
);
|
|
162
|
+
z-index: 6;
|
|
163
|
+
background-color: $ieeesa-white;
|
|
164
|
+
box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.18);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Pins a form's action bar to the bottom of the viewport so the primary and
|
|
168
|
+
// secondary buttons stay reachable without scrolling to the end of the form.
|
|
169
|
+
// When the content is shorter than the viewport the bar simply sits at the end
|
|
170
|
+
// of the content.
|
|
171
|
+
@mixin sticky-form-actions() {
|
|
172
|
+
position: sticky;
|
|
173
|
+
bottom: 0;
|
|
174
|
+
z-index: 5;
|
|
175
|
+
background-color: $ieeesa-white;
|
|
176
|
+
border-top: 1px solid $ieeesa-disabled-border-color;
|
|
177
|
+
box-shadow: 0 -4px 8px 0 rgba(0, 0, 0, 0.12);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Applied to the page scroll container of a form that uses `sticky-form-nav`
|
|
181
|
+
// and `sticky-form-actions`. Programmatic scrolls — focusing the first invalid
|
|
182
|
+
// field on submit, anchor navigation — would otherwise land the target behind
|
|
183
|
+
// the fixed app header, the sticky nav chrome or the sticky action bar.
|
|
184
|
+
// `$nav-height` is the height of that nav chrome and `$actions-height` the
|
|
185
|
+
// height of the action bar.
|
|
186
|
+
@mixin sticky-form-scroll-padding($nav-height: 64px, $actions-height: 72px) {
|
|
187
|
+
scroll-padding-top: calc(
|
|
188
|
+
var(--ieeesa-sticky-header-offset, 0px) +
|
|
189
|
+
var(--ieeesa-sticky-subheader-offset, 0px) + #{$nav-height}
|
|
190
|
+
);
|
|
191
|
+
scroll-padding-bottom: $actions-height;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// ── Record regions ───────────────────────────────────────────────────────────
|
|
195
|
+
|
|
196
|
+
// Bounds a region that grows with the number of records it displays (a
|
|
197
|
+
// timeslot/agenda/meeting list) so adding records scrolls the region instead of
|
|
198
|
+
// lengthening the page. This is the case the "must not expand indefinitely as
|
|
199
|
+
// additional records are displayed" requirement is about.
|
|
200
|
+
//
|
|
201
|
+
// `auto` on both axes means a scrollbar appears only when the content actually
|
|
202
|
+
// overflows, so short lists stay scrollbar-free, and wide rows scroll sideways
|
|
203
|
+
// rather than being wrapped or clipped.
|
|
204
|
+
@mixin bounded-record-region($max-height) {
|
|
205
|
+
max-height: $max-height;
|
|
206
|
+
overflow-y: auto;
|
|
207
|
+
overflow-x: auto;
|
|
208
|
+
}
|