@penskemediacorp/larva-css 0.7.3 → 1.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 (28) hide show
  1. package/build/css/algorithms.common.async.css +2 -2
  2. package/build/css/algorithms.common.inline.css +10 -10
  3. package/build/css/js.common.async.css +1 -0
  4. package/build/css/js.common.inline.css +3 -0
  5. package/build/css/utilities.common.inline.css +10 -8
  6. package/package.json +4 -4
  7. package/src/02-algorithms/a-children-border/a-children-border.common.inline.scss +8 -0
  8. package/src/02-algorithms/a-crop/a-crop.common.inline.scss +15 -0
  9. package/src/02-algorithms/a-glue/a-glue.common.inline.scss +28 -0
  10. package/src/02-algorithms/a-hidden/a-hidden.common.inline.scss +6 -0
  11. package/src/02-algorithms/a-icon/a-icon.common.async.scss +1 -1
  12. package/src/02-algorithms/a-icon/a-icon.common.inline.scss +17 -0
  13. package/src/03-utilities/u-border.common.inline.scss +46 -0
  14. package/src/03-utilities/u-box-alignment.common.inline.scss +4 -0
  15. package/src/03-utilities/u-display.common.inline.scss +20 -0
  16. package/src/03-utilities/u-font-size.common.inline.scss +1 -0
  17. package/src/03-utilities/u-height.common.inline.scss +37 -11
  18. package/src/03-utilities/u-letter-spacing.common.inline.scss +1 -1
  19. package/src/03-utilities/u-max-width.common.inline.scss +8 -0
  20. package/src/03-utilities/u-padding.common.inline.scss +4 -0
  21. package/src/03-utilities/u-transform.common.inline.scss +5 -0
  22. package/src/03-utilities/u-vertical-align.common.inline.scss +7 -0
  23. package/src/03-utilities/u-width.common.inline.scss +44 -0
  24. package/src/04-js/js-ExpandableSearch.common.async.scss +33 -0
  25. package/src/04-js/js-Header.common.inline.scss +73 -0
  26. package/src/04-js/js-MegaMenu.common.inline.scss +50 -0
  27. package/src/04-js/js-Tooltip.common.inline.scss +17 -0
  28. package/src/04-js/partials/expandable-search.scss +202 -0
@@ -30,6 +30,12 @@
30
30
  }
31
31
  }
32
32
 
33
+ .lrv-a-hidden\@tablet {
34
+ @include pmc-breakpoint( tablet ) {
35
+ @include _a-hidden;
36
+ }
37
+ }
38
+
33
39
  .lrv-a-hidden\@desktop {
34
40
  @include pmc-breakpoint( desktop ) {
35
41
  @include _a-hidden;
@@ -33,4 +33,4 @@
33
33
 
34
34
  .lrv-a-icon-search {
35
35
  --a-icon-url: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M5.228 11.335h.79l.28-.27a6.471 6.471 0 01-1.57-4.23 6.5 6.5 0 116.5 6.5c-1.61 0-3.09-.59-4.23-1.57l-.27.28v.79l-5 4.99-1.49-1.49 4.99-5zm6 0c2.49 0 4.5-2.01 4.5-4.5s-2.01-4.5-4.5-4.5-4.5 2.01-4.5 4.5 2.01 4.5 4.5 4.5z' fill-rule='evenodd'/%3E%3C/svg%3E" );
36
- }
36
+ }
@@ -102,3 +102,20 @@
102
102
  }
103
103
  }
104
104
 
105
+ .lrv-a-icon-after-arrow-top-right {
106
+ &::before {
107
+ position: absolute;
108
+ content: '';
109
+ display: block;
110
+ width: pmc-rem(24);
111
+ height: pmc-rem(24);
112
+ right: 13%;
113
+ border: 2px solid map-get( $TOKENS-MAP, color-black );
114
+ border-right-color: transparent;
115
+ border-bottom-color: transparent;
116
+ transform: rotate( 45deg );
117
+ top: pmc-rem(-12);
118
+ background-color: $color-white;
119
+ }
120
+ }
121
+
@@ -47,6 +47,46 @@
47
47
  border-width: pmc-rem(5);
48
48
  }
49
49
 
50
+ .lrv-u-border-t-6 {
51
+ border-top-width: pmc-rem(6);
52
+ }
53
+
54
+ .lrv-u-border-b-6 {
55
+ border-bottom-width: pmc-rem(6);
56
+ }
57
+
58
+ .lrv-u-border-r-1 {
59
+ border-right-width: pmc-rem(1);
60
+ }
61
+
62
+ .lrv-u-border-r-6 {
63
+ border-right-width: pmc-rem(6);
64
+ }
65
+
66
+ .lrv-u-border-r-2 {
67
+ border-right-width: pmc-rem(2);
68
+ }
69
+
70
+ .lrv-u-border-b-2 {
71
+ border-bottom-width: pmc-rem(2);
72
+ }
73
+
74
+ .lrv-u-border-l-2 {
75
+ border-left-width: pmc-rem(2);
76
+ }
77
+
78
+ .lrv-u-border-l-00\@mobile-max {
79
+ @include pmc-breakpoint(mobile-max) {
80
+ border-left-width: 0;
81
+ }
82
+ }
83
+
84
+ .lrv-u-border-a-1\@mobile-max {
85
+ @include pmc-breakpoint( mobile-max ) {
86
+ border-width: 1px;
87
+ }
88
+ }
89
+
50
90
  @include pmc-breakpoint( mobile-max ) {
51
91
  .lrv-u-border-a-1\@mobile-max {
52
92
  border-width: 1px;
@@ -136,3 +176,9 @@
136
176
  border-top-width: pmc-rem(1);
137
177
  }
138
178
  }
179
+
180
+ .lrv-u-border-b-2\@mobile-max {
181
+ @include pmc-breakpoint( mobile-max ) {
182
+ border-bottom-width: pmc-rem(2);
183
+ }
184
+ }
@@ -32,6 +32,10 @@
32
32
  align-items: flex-start;
33
33
  }
34
34
 
35
+ .lrv-u-align-items-stretch {
36
+ align-items: stretch;
37
+ }
38
+
35
39
  @include pmc-breakpoint( desktop ) {
36
40
  .lrv-u-align-items-center\@desktop {
37
41
  align-items: center;
@@ -71,4 +71,24 @@
71
71
  @include pmc-breakpoint( mobile-max ) {
72
72
  display: none;
73
73
  }
74
+ }
75
+
76
+ .lrv-u-display-none\:first-child\@desktop-max {
77
+ @include pmc-breakpoint( desktop-max ) {
78
+ &> *:first-child {
79
+ display: none;
80
+ }
81
+ }
82
+ }
83
+
84
+ .lrv-u-display-inline-block\@mobile-max {
85
+ @include pmc-breakpoint( mobile-max ) {
86
+ display: inline-block;
87
+ }
88
+ }
89
+
90
+ .lrv-u-display-block\@mobile-max {
91
+ @include pmc-breakpoint( mobile-max ) {
92
+ display: block;
93
+ }
74
94
  }
@@ -27,6 +27,7 @@
27
27
  ($font-size-40,)
28
28
  ($font-size-50,)
29
29
  ($font-size-86,)
30
+ ($font-size-8, mobile-max)
30
31
  ($font-size-12, mobile-max)
31
32
  ($font-size-14, mobile-max)
32
33
  ($font-size-16, mobile-max)
@@ -1,17 +1,43 @@
1
1
  @import '@penskemediacorp/larva-scss/dist/tools';
2
2
 
3
- .lrv-u-height-100p {
4
- height: 100%;
5
- }
3
+ $heights_map: (
4
+ 'height-auto': auto,
5
+ 'height-16': pmc-rem(16),
6
+ 'height-20': pmc-rem(20),
7
+ 'height-24': pmc-rem(24),
8
+ 'height-30': pmc-rem(30),
9
+ 'height-40': pmc-rem(40),
10
+ 'height-50': pmc-rem(50),
11
+ 'height-100': pmc-rem(100),
12
+ 'height-150': pmc-rem(150),
13
+ 'height-200': pmc-rem(200),
14
+ 'height-300': pmc-rem(300),
15
+ 'height-20p': 20%,
16
+ 'height-30p': 30%,
17
+ 'height-50p': 50%,
18
+ 'height-75p': 75%,
19
+ 'height-100p': 100%,
20
+ );
6
21
 
7
- .lrv-u-height-auto {
8
- height: auto;
9
- }
22
+ @include basic-utility-generator( 'height', (
23
+ height-auto,
24
+ height-16,
25
+ height-20,
26
+ height-24,
27
+ height-30,
28
+ height-40,
29
+ height-50,
30
+ height-100,
31
+ height-150,
32
+ height-200,
33
+ height-300,
34
+ height-20p,
35
+ height-30p,
36
+ height-50p,
37
+ height-75p,
38
+ height-100p,
39
+ ), $heights_map, $NAMESPACE: 'lrv-' );
10
40
 
11
41
  .lrv-u-max-height-50 {
12
42
  max-height: pmc-rem(50);
13
- }
14
-
15
- .lrv-u-height-16 {
16
- height: pmc-rem(16);
17
- }
43
+ }
@@ -8,4 +8,4 @@
8
8
  @include pmc-breakpoint( mobile-max ) {
9
9
  letter-spacing: pmc-rem(1.95);
10
10
  }
11
- }
11
+ }
@@ -12,6 +12,14 @@
12
12
  max-width: pmc-rem(150);
13
13
  }
14
14
 
15
+ .lrv-u-max-width-250 {
16
+ max-width: pmc-rem(250);
17
+ }
18
+
19
+ .lrv-u-max-width-500 {
20
+ max-width: pmc-rem(500);
21
+ }
22
+
15
23
  .lrv-u-max-width-1000 {
16
24
  max-width: pmc-rem(1000);
17
25
  }
@@ -79,12 +79,16 @@ $breakpoints: (
79
79
 
80
80
  // Legacy - should not have tablet and mobile-max
81
81
  $paddings_with_breakpoints: (
82
+ ('l', $spacer-3 ),
83
+
82
84
  ('tb', $spacer-025, mobile-max ),
83
85
  ('tb', $spacer-1, mobile-max),
84
86
 
85
87
  ('r', $spacer-1, tablet ),
86
88
  ('t', $spacer-050, tablet ),
87
89
  ('lr', $spacer-1, tablet ),
90
+
91
+ ('tb', $spacer-050, desktop-max),
88
92
  );
89
93
 
90
94
  @include u-padding( $paddings_with_breakpoints, $NAMESPACE: 'lrv-' );
@@ -0,0 +1,5 @@
1
+ @import 'setup';
2
+
3
+ .lrv-u-transform-translateY-n50p {
4
+ transform: translateY(-50%);
5
+ }
@@ -0,0 +1,7 @@
1
+ @import 'setup';
2
+
3
+ .lrv-u-vertical-align-middle\@mobile-max {
4
+ @include pmc-breakpoint(mobile-max) {
5
+ vertical-align: middle;
6
+ }
7
+ }
@@ -3,13 +3,17 @@
3
3
  $widths_map: (
4
4
  'width-auto': auto,
5
5
  'width-16': pmc-rem(16),
6
+ 'width-24': pmc-rem(24),
6
7
  'width-30': pmc-rem(30),
7
8
  'width-50': pmc-rem(50),
8
9
  'width-100': pmc-rem(100),
9
10
  'width-150': pmc-rem(150),
11
+ 'width-165': pmc-rem(165),
10
12
  'width-200': pmc-rem(200),
11
13
  'width-215': pmc-rem(215),
12
14
  'width-300': pmc-rem(300),
15
+ 'width-20p': 20%,
16
+ 'width-22p': 22%,
13
17
  'width-30p': 30%,
14
18
  'width-50p': 50%,
15
19
  'width-70p': 70%,
@@ -20,13 +24,17 @@ $widths_map: (
20
24
  @include basic-utility-generator( 'width', (
21
25
  width-auto,
22
26
  width-16,
27
+ width-24,
23
28
  width-30,
24
29
  width-50,
25
30
  width-100,
26
31
  width-150,
32
+ width-165,
27
33
  width-200,
28
34
  width-215,
29
35
  width-300,
36
+ width-20p,
37
+ width-22p,
30
38
  width-30p,
31
39
  width-50p,
32
40
  width-70p,
@@ -149,4 +157,40 @@ $widths_map: (
149
157
  @include pmc-breakpoint(tablet) {
150
158
  width: 35%;
151
159
  }
160
+ }
161
+
162
+ .lrv-u-max-width-30p\@mobile-max {
163
+ @include pmc-breakpoint(mobile-max) {
164
+ max-width: 30%;
165
+ }
166
+ }
167
+
168
+ .lrv-u-width-28\@mobile-max {
169
+ @include pmc-breakpoint(mobile-max) {
170
+ width: pmc-rem(28);
171
+ }
172
+ }
173
+
174
+ .lrv-u-width-22p\@mobile-max {
175
+ @include pmc-breakpoint(mobile-max) {
176
+ width: 22%;
177
+ }
178
+ }
179
+
180
+ .lrv-u-width-56p\@mobile-max {
181
+ @include pmc-breakpoint(mobile-max) {
182
+ width: 56%;
183
+ }
184
+ }
185
+
186
+ .lrv-u-width-135\@mobile-max {
187
+ @include pmc-breakpoint(mobile-max) {
188
+ width: pmc-rem(135);
189
+ }
190
+ }
191
+
192
+ .lrv-u-width-100p\@tablet {
193
+ @include pmc-breakpoint(tablet) {
194
+ width: 100%;
195
+ }
152
196
  }
@@ -0,0 +1,33 @@
1
+ @import 'setup';
2
+ @import 'partials/expandable-search';
3
+
4
+ .is-ExpandableSearch-open {
5
+ background-color: var( --color-brand-primary );
6
+ color: var( --color-white );
7
+ position: relative;
8
+
9
+ svg {
10
+ opacity: 0;
11
+ }
12
+
13
+ &::before,
14
+ &::after {
15
+ content: '';
16
+ position: absolute;
17
+ top: calc( 50% - #{pmc-rem(1)} );
18
+ left: calc( 50% - #{pmc-rem(10)} );
19
+ width: pmc-rem(20);
20
+ height: pmc-rem(2);
21
+ background-color: white;
22
+ transition: transform 600ms ease;
23
+ transform: rotateZ( 45deg );
24
+ }
25
+
26
+ &::after {
27
+ transform: rotateZ( -45deg );
28
+ }
29
+
30
+ &:hover {
31
+ color: var( --color-white );
32
+ }
33
+ }
@@ -0,0 +1,73 @@
1
+ @import 'setup';
2
+
3
+ // Functional styles for the sticky header. Visual styles are added with utilities
4
+ $sticky-transform-y: 3.125rem;
5
+ $mobile-header-height: #{var( --sticky-nav-height )};
6
+
7
+ // Package the base sticky positioning styles for use in mulitple places.
8
+ @mixin _sticky-header-positioning {
9
+ position: fixed;
10
+ width: 100%;
11
+ z-index: $z-index-sticky-header;
12
+ transform: translateY(0);
13
+ top: var(--login-bar-height, 0);
14
+ }
15
+
16
+ @keyframes slideDown {
17
+ 0% {
18
+ transform: translateY(-100%);
19
+ }
20
+
21
+ 100% {
22
+ transform: translateY(0);
23
+ }
24
+ }
25
+
26
+ // Needs to slide up still - problem is that it is display: none'd and that would have to have a delay before being applied
27
+ .js-sticky-header-slidedown {
28
+ @include pmc-breakpoint( desktop ) {
29
+ transform: translateY(-100%);
30
+ }
31
+ }
32
+
33
+ .is-sticky .js-sticky-header-slidedown {
34
+ @include pmc-breakpoint( desktop ) {
35
+ animation-name: slideDown;
36
+ animation-duration: 250ms;
37
+ animation-fill-mode: forwards;
38
+ transform: translateY(0);
39
+ }
40
+ }
41
+
42
+ // The data-header-sticky wrapper is not hooked up to JS, but provides the CSS transform for
43
+ // hiding/showing the sticky header.
44
+ .js-Header-contents {
45
+ position: relative;
46
+ transition: transform $transition-transform;
47
+ will-change: transform;
48
+
49
+ }
50
+
51
+ .has-side-skins .js-Header-contents {
52
+ max-width: $screen-desktop;
53
+ }
54
+
55
+ .is-sticky .js-Header-contents {
56
+ @include _sticky-header-positioning;
57
+ }
58
+
59
+ .js-hide-when-sticky {
60
+
61
+ .is-sticky & {
62
+ display: none;
63
+ }
64
+ }
65
+
66
+ .js-show-when-sticky {
67
+
68
+ display: none;
69
+
70
+ .is-sticky & {
71
+ display: block;
72
+ }
73
+ }
@@ -0,0 +1,50 @@
1
+ @import 'setup';
2
+
3
+ .js-MegaMenu {
4
+ --mega-menu-top-offset: var( --login-bar-height );
5
+
6
+ // Hidden state.
7
+ opacity: 0;
8
+ visibility: hidden;
9
+ pointer-events: none;
10
+ transform: translateY( calc( -100% - var( --mega-menu-top-offset ) ) );
11
+ // End hidden.
12
+
13
+ // Animation.
14
+ transition: opacity $transition-fade,
15
+ transform $transition-transform,
16
+ visibility $transition-transform;
17
+
18
+ // Adjust offset according to breakpoint and presence of menus.
19
+ @include pmc-breakpoint( desktop-max ) {
20
+ --mega-menu-top-offset: calc( var( --login-bar-height ) + var( --sticky-nav-height ) );
21
+ }
22
+
23
+ }
24
+
25
+ .is-mega-open body {
26
+ overflow: hidden;
27
+ }
28
+
29
+ // Default styling for mega menu hidden state needs to be part of critical CSS
30
+ // and is added in patterns/generic/js-interface.scss
31
+
32
+ .is-mega-open .js-MegaMenu {
33
+ // Toggle properties from hidden state.
34
+ opacity: 1;
35
+ visibility: visible;
36
+ transform: translateY(0);
37
+ pointer-events: initial;
38
+ }
39
+
40
+ // Move these
41
+ .mega-menu__parent-list-item {
42
+ background-color: map-get( $TOKENS-MAP, black );
43
+ transition: background-color ease $transition-duration-300;
44
+ }
45
+
46
+ .is-expanded.mega-menu__parent-list-item {
47
+ @include pmc-breakpoint( desktop-max ) {
48
+ background-color: map-get( $TOKENS-MAP, brand-red );
49
+ }
50
+ }
@@ -0,0 +1,17 @@
1
+ .js-Tooltip {
2
+ opacity: 0;
3
+ visibility: hidden;
4
+ position: absolute;
5
+ top: 100%;
6
+ transition: opacity 0.3 cubic-bezier(0.19,1,0.22,1);
7
+ }
8
+
9
+ .is-Tooltip-open .js-Tooltip {
10
+ opacity: 1;
11
+ visibility: visible;
12
+ }
13
+
14
+ .is-Tooltip-open .lrv-a-icon-arrow-down {
15
+ --a-icon-transform: rotate(-180deg);
16
+ }
17
+