@skyscanner/backpack-web 38.22.0 → 39.0.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.
Files changed (44) hide show
  1. package/bpk-mixins/_badges-v2.scss +37 -36
  2. package/bpk-mixins/_badges.scss +37 -36
  3. package/bpk-mixins/_borders.scss +16 -16
  4. package/bpk-mixins/_breakpoints.scss +11 -11
  5. package/bpk-mixins/_buttons.scss +141 -137
  6. package/bpk-mixins/_cards.scss +13 -13
  7. package/bpk-mixins/_chips.scss +66 -66
  8. package/bpk-mixins/_forms.scss +214 -202
  9. package/bpk-mixins/_icons.scss +7 -4
  10. package/bpk-mixins/_index.scss +19 -19
  11. package/bpk-mixins/_layers.scss +34 -34
  12. package/bpk-mixins/_margins.scss +3 -3
  13. package/bpk-mixins/_panels.scss +9 -9
  14. package/bpk-mixins/_radii.scss +6 -6
  15. package/bpk-mixins/_scroll-indicators.scss +2 -2
  16. package/bpk-mixins/_shadows.scss +4 -4
  17. package/bpk-mixins/_spinners.scss +10 -10
  18. package/bpk-mixins/_tokens.scss +1 -3
  19. package/bpk-mixins/_typography.scss +204 -195
  20. package/bpk-mixins/_utils.scss +17 -12
  21. package/bpk-stylesheets/index.scss +13 -14
  22. package/bpk-stylesheets/normalize.css +18 -422
  23. package/bpk-stylesheets/normalize.scss +422 -0
  24. package/package.json +1 -5
  25. package/unstable__bpk-mixins/_badges-v2.scss +0 -240
  26. package/unstable__bpk-mixins/_badges.scss +0 -240
  27. package/unstable__bpk-mixins/_borders.scss +0 -268
  28. package/unstable__bpk-mixins/_breakpoints.scss +0 -221
  29. package/unstable__bpk-mixins/_buttons.scss +0 -587
  30. package/unstable__bpk-mixins/_cards.scss +0 -94
  31. package/unstable__bpk-mixins/_chips.scss +0 -249
  32. package/unstable__bpk-mixins/_forms.scss +0 -1045
  33. package/unstable__bpk-mixins/_icons.scss +0 -88
  34. package/unstable__bpk-mixins/_index.scss +0 -38
  35. package/unstable__bpk-mixins/_layers.scss +0 -199
  36. package/unstable__bpk-mixins/_margins.scss +0 -75
  37. package/unstable__bpk-mixins/_panels.scss +0 -96
  38. package/unstable__bpk-mixins/_radii.scss +0 -80
  39. package/unstable__bpk-mixins/_scroll-indicators.scss +0 -79
  40. package/unstable__bpk-mixins/_shadows.scss +0 -58
  41. package/unstable__bpk-mixins/_spinners.scss +0 -102
  42. package/unstable__bpk-mixins/_tokens.scss +0 -19
  43. package/unstable__bpk-mixins/_typography.scss +0 -1225
  44. package/unstable__bpk-mixins/_utils.scss +0 -267
@@ -1,267 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- /* stylelint-disable at-rule-disallowed-list */
20
-
21
- @use "sass:string";
22
- @use 'tokens.scss';
23
-
24
- ////
25
- /// @group utils
26
- ////
27
-
28
- /// Standard focus indicator for elements.
29
- ///
30
- /// @example scss
31
- /// .selector {
32
- /// @include bpk-focus-indicator();
33
- /// }
34
-
35
- @mixin bpk-focus-indicator {
36
- outline: (tokens.$bpk-one-pixel-rem * 2) solid tokens.$bpk-text-link-day;
37
- outline-offset: (tokens.$bpk-one-pixel-rem * 2);
38
- }
39
-
40
- /// Hide visually and from screen readers.
41
- ///
42
- /// @example scss
43
- /// .selector {
44
- /// @include bpk-hidden();
45
- /// }
46
-
47
- @mixin bpk-hidden {
48
- display: none !important; /* stylelint-disable-line declaration-no-important */
49
- }
50
-
51
- /// Hide only visually, but have it available for screen readers:
52
- ///
53
- /// http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
54
- ///
55
- /// @example scss
56
- /// .selector {
57
- /// @include bpk-visually-hidden();
58
- /// }
59
-
60
- @mixin bpk-visually-hidden {
61
- position: absolute;
62
- width: 1px; /* stylelint-disable-line unit-disallowed-list */
63
- height: 1px; /* stylelint-disable-line unit-disallowed-list */
64
- margin: -1px; /* stylelint-disable-line unit-disallowed-list */
65
- padding: 0;
66
- border: 0;
67
- white-space: nowrap;
68
- overflow: hidden;
69
- clip: rect(0 0 0 0);
70
- }
71
-
72
- /// Modifies the bpk-visually-hidden mixin to allow the element to be focusable when navigated to via the keyboard:
73
- ///
74
- /// https://www.drupal.org/node/897638
75
- ///
76
- /// @require {mixin} bpk-visually-hidden
77
- ///
78
- /// @example scss
79
- /// .selector {
80
- /// @include bpk-visually-hidden();
81
- /// @include bpk-visually-hidden--focusable();
82
- /// }
83
-
84
- @mixin bpk-visually-hidden--focusable {
85
- &:active,
86
- &:focus {
87
- position: static;
88
- width: auto;
89
- height: auto;
90
- margin: 0;
91
- overflow: visible;
92
- clip: auto;
93
- }
94
- }
95
-
96
- /// Hide visually and from screen readers, but maintain layout.
97
- ///
98
- /// @example scss
99
- /// .selector {
100
- /// @include bpk-invisible();
101
- /// }
102
-
103
- @mixin bpk-invisible {
104
- visibility: hidden;
105
- }
106
-
107
- /// Clearfix: contain floats.
108
- ///
109
- /// @example scss
110
- /// .selector {
111
- /// @include bpk-clearfix();
112
- /// }
113
-
114
- @mixin bpk-clearfix {
115
- &::before,
116
- &::after {
117
- content: '';
118
- display: table;
119
- }
120
-
121
- &::after {
122
- clear: both;
123
- }
124
- }
125
-
126
- /// Target RTL specific styles.
127
- ///
128
- /// @content
129
- ///
130
- /// @example scss
131
- /// .selector {
132
- /// @include bpk-rtl() {
133
- /// /* RTL scss goes here */
134
- /// }
135
- /// }
136
-
137
- @mixin bpk-rtl {
138
- html[dir='rtl'] & {
139
- @content;
140
- }
141
- }
142
-
143
- /// :hover pseudo selector wrapper which prevents styles displaying on touch devices
144
- ///
145
- /// @content
146
- ///
147
- /// @example scss
148
- /// .selector {
149
- /// @include bpk-hover() {
150
- /// /* Non-touch specific hover scss goes here */
151
- /// }
152
- /// }
153
-
154
- @mixin bpk-hover {
155
- .bpk-no-touch-support &:hover:not(:active):not(:disabled) {
156
- @content;
157
- }
158
-
159
- // Duplicating the above rule with `:global(...)` pseudo selector around the
160
- // global `.bpk-no-touch-support` class to provide support for CSS modules.
161
- // - when processed through css-loader, the `:global(...)` pseudo selector will be dropped
162
- // leaving a duplicate rule which in turn will be 'uglified' out - so no worries there
163
- // - when processed through node-sass only, the `:global(...)` pseudo selector will be left
164
- // intact and ignored by all browsers
165
- // stylelint-disable-next-line selector-pseudo-class-no-unknown
166
- :global(.bpk-no-touch-support) &:hover:not(:active):not(:disabled) {
167
- @content;
168
- }
169
- }
170
-
171
- /// Target locale specific styles.
172
- ///
173
- /// @content
174
- ///
175
- /// @example scss
176
- /// .selector {
177
- /// @include bpk-locale('ja-JP') {
178
- /// /* ja-JP scss goes here */
179
- /// }
180
- /// }
181
-
182
- @mixin bpk-locale($locale) {
183
- html[lang='#{$locale}'] &,
184
- html[lang='#{string.to_lower_case($locale)}'] & {
185
- @content;
186
- }
187
- }
188
-
189
- /// Create a Backpack themeable property with
190
- /// fallback support for old browsers and when
191
- /// the CSS variable is not defined.
192
- ///
193
- /// @content
194
- ///
195
- /// @example scss
196
- /// .selector {
197
- /// @include bpk-themeable-property(color, --bpk-link-text-color, $fallback-text-color);
198
- /// }
199
-
200
- @mixin bpk-themeable-property($property, $variableName, $fallback) {
201
- #{$property}: $fallback;
202
- #{$property}: var($variableName, $fallback);
203
- }
204
-
205
- /// Create a property that uses the Backpack primary color blue-500.
206
- ///
207
- /// @content
208
- ///
209
- /// @example scss
210
- /// .selector {
211
- /// @include bpk-apply-primary-color-to(color);
212
- /// }
213
- @mixin bpk-apply-primary-color-to($property) {
214
- @include bpk-themeable-property(
215
- $property,
216
- --bpk-primary-color,
217
- tokens.$bpk-color-sky-blue
218
- );
219
- }
220
-
221
- /// Replace part of a string with another string.
222
- ///
223
- /// @param {string} $string - The string inside which the replacement should take place.
224
- /// @param {string} $search - The substring to be replaced.
225
- /// @param {string} $replace [''] - The string to replace $search.
226
-
227
- @function str-replace($string, $search, $replace: '') {
228
- /* Disabling rule here as the recommendation method is for newer sass versions that we don't yet support */
229
- /* stylelint-disable-next-line scss/no-global-function-names */
230
- $index: string.index($string, $search);
231
-
232
- @if $index {
233
- @return string.slice($string, 1, $index - 1) + $replace +
234
- str-replace(
235
- string.slice($string, $index + string.length($search)),
236
- $search,
237
- $replace
238
- );
239
- }
240
-
241
- @return $string;
242
- }
243
-
244
- /// Increases the tappable area of the element to the
245
- /// minimum required for touch devices.
246
- ///
247
- /// @content
248
- ///
249
- /// @example scss
250
- /// .selector {
251
- /// @include bpk-touch-area;
252
- /// }
253
-
254
- @mixin bpk-touch-tappable {
255
- position: relative;
256
-
257
- &::before {
258
- position: absolute;
259
- /* stylelint-disable-next-line function-calc-no-invalid */
260
- top: calc((-#{tokens.bpk-spacing-xxl() + tokens.bpk-spacing-sm()} / 2) + 50%);
261
- /* stylelint-disable-next-line function-calc-no-invalid */
262
- left: calc((-#{tokens.bpk-spacing-xxl() + tokens.bpk-spacing-sm()} / 2) + 50%);
263
- content: '';
264
- width: tokens.bpk-spacing-xxl() + tokens.bpk-spacing-sm();
265
- height: tokens.bpk-spacing-xxl() + tokens.bpk-spacing-sm();
266
- }
267
- }