@penskemediacorp/larva-css 1.7.0-alpha.0 → 1.7.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 (111) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +206 -19
  3. package/__tests__/fixtures/expected.js +29 -0
  4. package/__tests__/lib/generators.test.js +11 -0
  5. package/build/css/algorithms.common.async.css +4 -36
  6. package/build/css/algorithms.common.inline.css +21 -274
  7. package/build/css/generic.common.inline.css +4 -67
  8. package/build/css/js.common.async.css +3 -0
  9. package/build/css/js.common.inline.css +6 -9
  10. package/build/css/utilities.common.async.css +8 -55
  11. package/build/css/utilities.common.inline.css +27 -473
  12. package/gulpfile.js +110 -82
  13. package/lib/generators.js +93 -0
  14. package/package.json +14 -6
  15. package/src/01-generic/elements.common.inline.scss +33 -1
  16. package/src/01-generic/forms.common.inline.scss +10 -0
  17. package/src/01-generic/side-skins.common.inline.scss +10 -0
  18. package/src/01-generic/typography.common.inline.scss +23 -13
  19. package/src/02-algorithms/a-buy-now/a-buy-now.common.inline.scss +112 -0
  20. package/src/02-algorithms/a-carousel-grid/a-carousel-grid.common.inline.scss +66 -0
  21. package/src/02-algorithms/a-children-border/a-children-border.common.inline.scss +43 -0
  22. package/src/02-algorithms/a-children-link-color/a-children-link-color.common.inline.scss +15 -0
  23. package/src/02-algorithms/a-children-link-decoration/a-children-link-decoration.common.inline.scss +13 -0
  24. package/src/02-algorithms/a-counter/a-counter.common.inline.scss +26 -0
  25. package/src/02-algorithms/a-crop/README.md +17 -13
  26. package/src/02-algorithms/a-crop/a-crop.common.inline.scss +96 -12
  27. package/src/02-algorithms/a-crop/a-crop.html +2 -2
  28. package/src/02-algorithms/a-floated/a-floated.common.inline.scss +32 -0
  29. package/src/02-algorithms/a-font/a-font.common.inline.scss +3 -0
  30. package/src/02-algorithms/a-glue/a-glue.common.inline.scss +63 -6
  31. package/src/02-algorithms/a-glue/a-glue.html +3 -3
  32. package/src/02-algorithms/a-grid/README.md +141 -14
  33. package/src/02-algorithms/a-grid/a-grid.common.inline.scss +53 -5
  34. package/src/02-algorithms/a-grid/a-grid.html +4 -4
  35. package/src/02-algorithms/a-hidden/a-hidden.common.inline.scss +43 -0
  36. package/src/02-algorithms/a-hover-dropup/a-hover-dropup.common.async.scss +7 -7
  37. package/src/02-algorithms/a-hover-dropup/a-hover-dropup.html +3 -3
  38. package/src/02-algorithms/a-hover-effect/a-hover-effect.common.async.scss +25 -0
  39. package/src/02-algorithms/a-hover-effect/a-hover-effect.html +16 -0
  40. package/src/02-algorithms/a-icon/a-icon.common.async.scss +28 -3
  41. package/src/02-algorithms/a-icon/a-icon.common.inline.scss +51 -73
  42. package/src/02-algorithms/a-screen-reader-only/a-screen-reader-only.common.inline.scss +30 -0
  43. package/src/02-algorithms/a-scrollable-grid/a-scrollable-grid.common.inline.scss +52 -0
  44. package/src/02-algorithms/a-show-on-hover/a-show-on-hover.common.inline.scss +16 -0
  45. package/src/02-algorithms/a-space-children/a-space-children.common.inline.scss +88 -17
  46. package/src/02-algorithms/a-truncate-ellipsis/a-truncate-ellipsis.common.async.scss +71 -0
  47. package/src/02-algorithms/a-unstyle-button/a-unstyle-button.common.inline.scss +2 -3
  48. package/src/02-algorithms/a-unstyle-link/a-unstyle-link.common.inline.scss +7 -0
  49. package/src/02-algorithms/a-unstyle-list/a-unstyle-list.common.inline.scss +1 -1
  50. package/src/02-algorithms/a-wrapper/a-wrapper.common.inline.scss +14 -2
  51. package/src/03-utilities/u-background-color.common.async.scss +15 -0
  52. package/src/03-utilities/u-background-color.common.inline.scss +37 -0
  53. package/src/03-utilities/u-border-color.common.async.scss +36 -8
  54. package/src/03-utilities/u-border-radius.common.async.scss +26 -2
  55. package/src/03-utilities/u-border.common.inline.scss +215 -4
  56. package/src/03-utilities/u-box-alignment.common.inline.scss +64 -4
  57. package/src/03-utilities/u-box-shadow.common.async.scss +34 -3
  58. package/src/03-utilities/u-color.common.async.scss +19 -21
  59. package/src/03-utilities/u-color.common.inline.scss +39 -0
  60. package/src/03-utilities/u-cursor.common.async.scss +1 -1
  61. package/src/03-utilities/u-display.common.inline.scss +87 -4
  62. package/src/03-utilities/u-filter.common.async.scss +5 -0
  63. package/src/03-utilities/u-flex.common.inline.scss +151 -9
  64. package/src/03-utilities/u-font-family.common.inline.scss +41 -17
  65. package/src/03-utilities/u-font-size.common.inline.scss +58 -5
  66. package/src/03-utilities/u-font-style.common.inline.scss +9 -0
  67. package/src/03-utilities/u-font-weight.common.inline.scss +50 -12
  68. package/src/03-utilities/u-height.common.inline.scss +38 -8
  69. package/src/03-utilities/u-letter-spacing.common.inline.scss +11 -0
  70. package/src/03-utilities/u-line-height.common.inline.scss +49 -13
  71. package/src/03-utilities/u-list-style.common.async.scss +3 -0
  72. package/src/03-utilities/u-margin.common.inline.scss +182 -47
  73. package/src/03-utilities/u-max-width.common.inline.scss +25 -0
  74. package/src/03-utilities/u-opacity.common.inline.scss +3 -0
  75. package/src/03-utilities/u-order.common.inline.scss +29 -2
  76. package/src/03-utilities/u-overflow.common.inline.scss +14 -2
  77. package/src/03-utilities/u-padding.common.inline.scss +157 -52
  78. package/src/03-utilities/u-position.common.inline.scss +3 -0
  79. package/src/03-utilities/u-text-align.common.inline.scss +27 -4
  80. package/src/03-utilities/u-text-decoration.common.inline.scss +11 -0
  81. package/src/03-utilities/u-text-transform.common.inline.scss +14 -2
  82. package/src/03-utilities/u-transform.common.inline.scss +5 -0
  83. package/src/03-utilities/u-vertical-align.common.inline.scss +7 -0
  84. package/src/03-utilities/u-whitespace.common.inline.scss +1 -1
  85. package/src/03-utilities/u-width.common.inline.scss +192 -12
  86. package/src/04-js/README.md +5 -0
  87. package/src/04-js/js-Collapsible.common.inline.scss +15 -0
  88. package/src/04-js/js-ExpandableSearch.common.async.scss +33 -0
  89. package/src/04-js/js-Flickity.common.async.scss +91 -0
  90. package/src/04-js/js-Header.common.inline.scss +73 -0
  91. package/src/04-js/js-MegaMenu.common.inline.scss +50 -0
  92. package/src/04-js/js-MobileHeightToggle.common.inline.scss +7 -5
  93. package/src/04-js/js-PopOver.common.async.scss +13 -0
  94. package/src/04-js/js-Tooltip.common.inline.scss +17 -0
  95. package/src/04-js/js-VideoShowcase.common.inline.scss +33 -0
  96. package/src/04-js/partials/expandable-search.scss +202 -0
  97. package/src/04-js/partials/flickity.scss +149 -0
  98. package/src/_generated/_a-font.scss +1027 -0
  99. package/src/larva-ui/prism.scss +127 -0
  100. package/src/setup.scss +7 -0
  101. package/stylelint.config.js +10 -11
  102. package/holding/a-truncate-children/README.md +0 -3
  103. package/holding/a-truncate-children/a-truncate-children.browser-test.js +0 -104
  104. package/holding/a-truncate-children/a-truncate-children.css +0 -4
  105. package/holding/a-truncate-children/a-truncate-children.html +0 -15
  106. package/holding/a-truncate-children/a-truncate-children.scss +0 -5
  107. package/src/01-generic/config.common.inline.scss +0 -24
  108. package/src/02-algorithms/a-glue/index.js +0 -1
  109. package/src/02-algorithms/a-icon/a-icon.html +0 -20
  110. package/src/02-algorithms/a-unstyle-link/a-unstyle-link.common.async.scss +0 -5
  111. package/src/03-utilities/u-background.common.async.scss +0 -25
@@ -0,0 +1,202 @@
1
+ @import 'setup';
2
+
3
+ // Note:
4
+ // Swiftype markup is generated dynamically, so plain CSS is used instead of
5
+ // Larva CSS classes.
6
+
7
+ // The Swiftype module appears in 3 modules, or contexts:
8
+ // 1. header (desktop, not sticky)
9
+ // 2. header-sticky (desktop, sticky)
10
+ // 3. mega-menu (all sizes)
11
+
12
+ // The CSS is structured like so:
13
+ // Base styles that apply to everything added to .swiftype.
14
+ // Style specific for each context, applied by adding specificity with .context-module .swiftype.
15
+ // BEM modifier classes are intentionally not used because the specificity is helpful here,
16
+ // and we can use the exiting module classes instead of creating new names for modifiers.
17
+
18
+ //
19
+ // Base module styles
20
+ //
21
+ .expandable-search {
22
+ color: var( --color-black );
23
+
24
+ $border-size: pmc-rem(2);
25
+ $input-width: pmc-rem(44);
26
+
27
+ .search-form {
28
+ display: flex;
29
+ position: relative;
30
+ }
31
+
32
+ // Search icon over input
33
+ .search-form::after {
34
+ content: '';
35
+ position: absolute;
36
+ top: 50%;
37
+ right: $spacer-1;
38
+
39
+ // Basically a-icon
40
+ content: '';
41
+ // search.svg from larva-svg.
42
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Ctitle%3ESearch Icon%3C/title%3E%3Cpath d='M17.7 16.3l-1.5 1.5-5-5V12l-.2-.2c-1.1 1-2.6 1.6-4.2 1.6-3.6 0-6.5-2.9-6.5-6.5S3.2.4 6.8.4s6.5 2.9 6.5 6.5c0 1.6-.6 3.1-1.6 4.2l.3.3h.8l4.9 4.9zm-6.5-9.5c0-2.5-2-4.5-4.5-4.5s-4.5 2-4.5 4.5 2 4.5 4.5 4.5 4.5-2 4.5-4.5z' fill-rule='evenodd'/%3E%3C/svg%3E");
43
+ height: pmc-rem(24);
44
+ width: pmc-rem(24);
45
+ background-repeat: no-repeat;
46
+ background-size: contain;
47
+ transform: translateY( -50% );
48
+ pointer-events: none;
49
+ z-index: 2;
50
+ transition: $transition-transform transform;
51
+ }
52
+
53
+ .search-form > label:first-of-type {
54
+ position: relative;
55
+ }
56
+
57
+ .search-form > label:first-of-type::after {
58
+ content: '';
59
+ position: absolute;
60
+ bottom: pmc-rem(17);
61
+ left: pmc-rem(20);
62
+ height: pmc-rem(1);
63
+ background-color: map-get( $TOKENS-MAP, background-color-black );
64
+ width: calc(100% - 5rem);
65
+ display: inline-block;
66
+ z-index: 9;
67
+ }
68
+
69
+ // White swatch to cover submit text
70
+ .search-form::before {
71
+ background-color: map-get( $TOKENS-MAP, background-color-white );
72
+ content: '';
73
+ position: absolute;
74
+ right: $border-size;
75
+ top: $border-size;
76
+ height: calc( 100% - #{$border-size} * 2 );
77
+ width: $input-width;
78
+ z-index: 1;
79
+ pointer-events: none;
80
+ }
81
+
82
+ // Style input text to be invisible, hidden beneath search icon.
83
+ .search-form input[type='text'],
84
+ .search-form input[type='search'] {
85
+ border: 2px solid var( --color-black );
86
+ padding: $spacer-050 $spacer-125 ;
87
+ min-width: pmc-rem(300);
88
+ font-family: var( --font-family-body );
89
+ box-shadow: $shadow-light;
90
+ font-size: pmc-rem(10);
91
+ height: pmc-rem(62);
92
+ position: relative;
93
+ &::-webkit-input-placeholder { /* Edge */
94
+ color: var( --color-black );
95
+ text-transform: uppercase;
96
+ }
97
+
98
+ &:-ms-input-placeholder { /* Internet Explorer 10-11 */
99
+ color: var( --color-black );
100
+ text-transform: uppercase;
101
+ }
102
+
103
+ &::placeholder {
104
+ color: var( --color-black );
105
+ text-transform: uppercase;
106
+ }
107
+ }
108
+
109
+ .search-form input[type='submit'] {
110
+ position: absolute;
111
+ right: $border-size;
112
+ height: 100%;
113
+ width: $input-width;
114
+ overflow: hidden;
115
+
116
+ // lrv-a-unstyle-button
117
+ border: 0;
118
+ background-color: transparent;
119
+ cursor: pointer;
120
+ }
121
+
122
+ .swiftype-widget {
123
+ background-color: var( --background-color-body );
124
+ box-shadow: $shadow-medium;
125
+ }
126
+
127
+ .ac-section-title {
128
+ font-family: var( --font-family-basic );
129
+ padding-bottom: $spacer-025;
130
+ font-size: $font-size-14;
131
+ font-weight: var( --font-weight-bold );
132
+ text-transform: uppercase;
133
+ padding-left: $spacer-050;
134
+ padding-right: $spacer-050;
135
+ }
136
+
137
+ .autocomplete-section {
138
+ padding-top: $spacer-1;
139
+ }
140
+
141
+ .ac-result {
142
+ padding: $spacer-050;
143
+ }
144
+
145
+ .ac-result:hover,
146
+ .ac-result:focus {
147
+ color: var( --color-brand-primary );
148
+ background-color: var( --background-color-grey-lightest );
149
+ cursor: pointer;
150
+ }
151
+
152
+ .ac-result em {
153
+ font-weight: var( --font-weight-bold );
154
+ font-style: normal;
155
+ }
156
+
157
+ .ac-result {
158
+ border-top: 1px solid var( --color-grey-light );
159
+ }
160
+
161
+ .ac_title {
162
+ font-family: var( --font-family-primary );
163
+ line-height: var( --line-height-normal );
164
+ }
165
+
166
+ .ac_title,
167
+ .ac_tag {
168
+ font-family: var( --font-family-body );
169
+ font-size: $font-size-16;
170
+ }
171
+
172
+ .ac_sub {
173
+ font-family: var( --font-family-body );
174
+ font-size: $font-size-14;
175
+ font-style: italic;
176
+ color: var( --color-grey-dark );
177
+ }
178
+
179
+ .sticky-expandable {
180
+ .search-form {
181
+ &> label:first-of-type::after {
182
+ left: 3.2rem;
183
+ }
184
+ &::before {
185
+ left: 0.125rem;
186
+ right: unset;
187
+ }
188
+ &::after {
189
+ left: 1rem;
190
+ right: unset;
191
+ }
192
+ input[type=search] {
193
+ padding: .5rem 1.25rem .5rem 3.2rem;
194
+ }
195
+ input[type=submit] {
196
+ left: 0.125rem;
197
+ right: unset;
198
+ }
199
+ }
200
+ }
201
+
202
+ }
@@ -0,0 +1,149 @@
1
+ // Third party CSS, so we will disable stylelint.
2
+ // stylelint-disable
3
+ /*! Flickity v2.2.1 https://flickity.metafizzy.co */
4
+
5
+ .flickity-enabled {
6
+ position: relative;
7
+ }
8
+
9
+ .flickity-enabled:focus {
10
+ outline: none;
11
+ }
12
+
13
+ .flickity-viewport {
14
+ overflow: hidden;
15
+ position: relative;
16
+ height: 100%;
17
+ }
18
+
19
+ .flickity-slider {
20
+ position: absolute;
21
+ width: 100%;
22
+ height: 100%;
23
+ }
24
+
25
+ /* draggable */
26
+
27
+ .flickity-enabled.is-draggable {
28
+ -webkit-tap-highlight-color: transparent;
29
+ -webkit-user-select: none;
30
+ -moz-user-select: none;
31
+ -ms-user-select: none;
32
+ user-select: none;
33
+ }
34
+
35
+ .flickity-enabled.is-draggable .flickity-viewport {
36
+ cursor: move;
37
+ cursor: -webkit-grab;
38
+ cursor: grab;
39
+ }
40
+
41
+ .flickity-enabled.is-draggable .flickity-viewport.is-pointer-down {
42
+ cursor: -webkit-grabbing;
43
+ cursor: grabbing;
44
+ }
45
+
46
+ /* ---- flickity-button ---- */
47
+
48
+ .flickity-button {
49
+ position: absolute;
50
+ background: hsla(0, 0%, 100%, 0.75);
51
+ border: none;
52
+ color: #333;
53
+ }
54
+
55
+ .flickity-button:hover {
56
+ background: white;
57
+ cursor: pointer;
58
+ }
59
+
60
+ .flickity-button:focus {
61
+ outline: none;
62
+ box-shadow: 0 0 0 5px #19F;
63
+ }
64
+
65
+ .flickity-button:active {
66
+ opacity: 0.6;
67
+ }
68
+
69
+ .flickity-button:disabled {
70
+ opacity: 0.3;
71
+ cursor: auto;
72
+ /* prevent disabled button from capturing pointer up event. #716 */
73
+ pointer-events: none;
74
+ }
75
+
76
+ .flickity-button-icon {
77
+ fill: currentColor;
78
+ }
79
+
80
+ /* ---- previous/next buttons ---- */
81
+
82
+ .flickity-prev-next-button {
83
+ top: 50%;
84
+ width: 44px;
85
+ height: 44px;
86
+ border-radius: 50%;
87
+ /* vertically center */
88
+ transform: translateY(-50%);
89
+ }
90
+
91
+ .flickity-prev-next-button.previous {
92
+ left: 10px;
93
+ }
94
+
95
+ .flickity-prev-next-button.next {
96
+ right: 10px;
97
+ }
98
+
99
+ /* right to left */
100
+ .flickity-rtl .flickity-prev-next-button.previous {
101
+ left: auto;
102
+ right: 10px;
103
+ }
104
+
105
+ .flickity-rtl .flickity-prev-next-button.next {
106
+ right: auto;
107
+ left: 10px;
108
+ }
109
+
110
+ .flickity-prev-next-button .flickity-button-icon {
111
+ position: absolute;
112
+ left: 20%;
113
+ top: 20%;
114
+ width: 60%;
115
+ height: 60%;
116
+ }
117
+
118
+ /* ---- page dots ---- */
119
+
120
+ .flickity-page-dots {
121
+ position: absolute;
122
+ width: 100%;
123
+ bottom: -25px;
124
+ padding: 0;
125
+ margin: 0;
126
+ list-style: none;
127
+ text-align: center;
128
+ line-height: 1;
129
+ }
130
+
131
+ .flickity-rtl .flickity-page-dots {
132
+ direction: rtl;
133
+ }
134
+
135
+ .flickity-page-dots .dot {
136
+ display: inline-block;
137
+ width: 10px;
138
+ height: 10px;
139
+ margin: 0 8px;
140
+ background: #333;
141
+ border-radius: 50%;
142
+ opacity: 0.25;
143
+ cursor: pointer;
144
+ }
145
+
146
+ .flickity-page-dots .dot.is-selected {
147
+ opacity: 1;
148
+ }
149
+ // stylelint-enable