@penskemediacorp/larva-css 1.5.0-alpha.0 → 1.5.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 (108) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +193 -37
  3. package/__tests__/fixtures/expected.js +29 -0
  4. package/__tests__/lib/generators.test.js +11 -0
  5. package/browser-test-setup.js +26 -0
  6. package/build/css/algorithms.common.async.css +4 -0
  7. package/build/css/algorithms.common.inline.css +21 -0
  8. package/build/css/generic.common.inline.css +4 -0
  9. package/build/css/js.common.async.css +3 -0
  10. package/build/css/js.common.inline.css +6 -0
  11. package/build/css/utilities.common.async.css +8 -0
  12. package/build/css/utilities.common.inline.css +27 -0
  13. package/gulpfile.js +123 -0
  14. package/lib/generators.js +93 -0
  15. package/package.json +14 -15
  16. package/src/01-generic/elements.common.inline.scss +37 -1
  17. package/src/01-generic/forms.common.inline.scss +10 -0
  18. package/src/01-generic/side-skins.common.inline.scss +10 -0
  19. package/src/01-generic/typography.common.inline.scss +24 -13
  20. package/src/02-algorithms/README.md +65 -0
  21. package/src/02-algorithms/a-buy-now/a-buy-now.common.inline.scss +112 -0
  22. package/src/02-algorithms/a-carousel-grid/a-carousel-grid.common.inline.scss +66 -0
  23. package/src/02-algorithms/a-children-border/a-children-border.common.inline.scss +43 -0
  24. package/src/02-algorithms/a-children-link-color/a-children-link-color.common.inline.scss +15 -0
  25. package/src/02-algorithms/a-children-link-decoration/a-children-link-decoration.common.inline.scss +13 -0
  26. package/src/02-algorithms/a-counter/a-counter.common.inline.scss +26 -0
  27. package/src/02-algorithms/a-crop/README.md +17 -13
  28. package/src/02-algorithms/a-crop/a-crop.common.inline.scss +97 -12
  29. package/src/02-algorithms/a-crop/a-crop.html +2 -2
  30. package/src/02-algorithms/a-floated/a-floated.common.inline.scss +32 -0
  31. package/src/02-algorithms/a-font/a-font.common.inline.scss +3 -0
  32. package/src/02-algorithms/a-glue/a-glue.common.inline.scss +63 -6
  33. package/src/02-algorithms/a-glue/a-glue.html +3 -3
  34. package/src/02-algorithms/a-grid/README.md +141 -14
  35. package/src/02-algorithms/a-grid/a-grid.common.inline.scss +58 -6
  36. package/src/02-algorithms/a-grid/a-grid.html +4 -4
  37. package/src/02-algorithms/a-hidden/a-hidden.common.inline.scss +43 -0
  38. package/src/02-algorithms/a-hover-dropup/a-hover-dropup.common.async.scss +9 -8
  39. package/src/02-algorithms/a-hover-dropup/a-hover-dropup.html +3 -3
  40. package/src/02-algorithms/a-hover-effect/a-hover-effect.common.async.scss +25 -0
  41. package/src/02-algorithms/a-hover-effect/a-hover-effect.html +16 -0
  42. package/src/02-algorithms/a-icon/a-icon.common.async.scss +36 -0
  43. package/src/02-algorithms/a-icon/a-icon.common.inline.scss +56 -70
  44. package/src/02-algorithms/a-screen-reader-only/a-screen-reader-only.common.inline.scss +30 -0
  45. package/src/02-algorithms/a-scrollable-grid/a-scrollable-grid.common.inline.scss +52 -0
  46. package/src/02-algorithms/a-show-on-hover/a-show-on-hover.common.inline.scss +16 -0
  47. package/src/02-algorithms/a-space-children/a-space-children.common.inline.scss +88 -17
  48. package/src/02-algorithms/a-truncate-ellipsis/a-truncate-ellipsis.common.async.scss +71 -0
  49. package/src/02-algorithms/a-unstyle-button/a-unstyle-button.common.inline.scss +2 -3
  50. package/src/02-algorithms/a-unstyle-link/a-unstyle-link.common.inline.scss +7 -0
  51. package/src/02-algorithms/a-unstyle-list/a-unstyle-list.common.inline.scss +1 -1
  52. package/src/02-algorithms/a-wrapper/a-wrapper.common.inline.scss +14 -2
  53. package/src/03-utilities/u-background-color.common.async.scss +15 -0
  54. package/src/03-utilities/u-background-color.common.inline.scss +37 -0
  55. package/src/03-utilities/u-border-color.common.async.scss +38 -6
  56. package/src/03-utilities/u-border-radius.common.async.scss +27 -0
  57. package/src/03-utilities/u-border.common.inline.scss +216 -3
  58. package/src/03-utilities/u-box-alignment.common.inline.scss +64 -4
  59. package/src/03-utilities/u-box-shadow.common.async.scss +37 -3
  60. package/src/03-utilities/u-color.common.async.scss +20 -15
  61. package/src/03-utilities/u-color.common.inline.scss +39 -0
  62. package/src/03-utilities/u-cursor.common.async.scss +1 -1
  63. package/src/03-utilities/u-display.common.inline.scss +86 -3
  64. package/src/03-utilities/u-filter.common.async.scss +5 -0
  65. package/src/03-utilities/u-flex.common.inline.scss +128 -9
  66. package/src/03-utilities/u-font-family.common.inline.scss +41 -16
  67. package/src/03-utilities/u-font-size.common.inline.scss +58 -5
  68. package/src/03-utilities/u-font-style.common.inline.scss +9 -0
  69. package/src/03-utilities/u-font-weight.common.inline.scss +50 -12
  70. package/src/03-utilities/u-height.common.inline.scss +41 -5
  71. package/src/03-utilities/u-letter-spacing.common.inline.scss +11 -0
  72. package/src/03-utilities/u-line-height.common.inline.scss +49 -13
  73. package/src/03-utilities/u-list-style.common.async.scss +3 -0
  74. package/src/03-utilities/u-margin.common.inline.scss +186 -46
  75. package/src/03-utilities/u-max-width.common.inline.scss +25 -0
  76. package/src/03-utilities/u-opacity.common.inline.scss +3 -0
  77. package/src/03-utilities/u-order.common.inline.scss +23 -2
  78. package/src/03-utilities/u-overflow.common.inline.scss +15 -0
  79. package/src/03-utilities/u-padding.common.inline.scss +157 -52
  80. package/src/03-utilities/u-position.common.inline.scss +3 -0
  81. package/src/03-utilities/u-text-align.common.inline.scss +32 -3
  82. package/src/03-utilities/u-text-decoration.common.inline.scss +11 -0
  83. package/src/03-utilities/u-text-transform.common.inline.scss +14 -2
  84. package/src/03-utilities/u-transform.common.inline.scss +5 -0
  85. package/src/03-utilities/u-vertical-align.common.inline.scss +7 -0
  86. package/src/03-utilities/u-whitespace.common.inline.scss +1 -1
  87. package/src/03-utilities/u-width.common.inline.scss +191 -7
  88. package/src/04-js/README.md +5 -0
  89. package/src/04-js/js-Collapsible.common.inline.scss +15 -0
  90. package/src/04-js/js-ExpandableSearch.common.async.scss +33 -0
  91. package/src/04-js/js-Flickity.common.async.scss +91 -0
  92. package/src/04-js/js-Header.common.inline.scss +73 -0
  93. package/src/04-js/js-MegaMenu.common.inline.scss +50 -0
  94. package/src/04-js/js-MobileHeightToggle.common.inline.scss +7 -5
  95. package/src/04-js/js-PopOver.common.async.scss +13 -0
  96. package/src/04-js/js-Tooltip.common.inline.scss +17 -0
  97. package/src/04-js/js-VideoShowcase.common.inline.scss +33 -0
  98. package/src/04-js/partials/expandable-search.scss +202 -0
  99. package/src/04-js/partials/flickity.scss +149 -0
  100. package/src/_generated/_a-font.scss +1027 -0
  101. package/src/larva-ui/prism.scss +127 -0
  102. package/src/setup.scss +7 -0
  103. package/stylelint.config.js +45 -0
  104. package/src/01-generic/config.common.inline.scss +0 -20
  105. package/src/02-algorithms/a-glue/index.js +0 -1
  106. package/src/02-algorithms/a-icon/a-icon.html +0 -20
  107. package/src/02-algorithms/a-unstyle-link/a-unstyle-link.common.async.scss +0 -5
  108. package/src/03-utilities/u-background.common.async.scss +0 -14
@@ -1,20 +1,147 @@
1
- # Grid
1
+ # a-grid
2
2
 
3
- Grids must be in order of media queries to maintain the cascade,
4
- e.g. desktop-xl grids are at the very end, breakpoint-less grids at
5
- the top.
3
+ This utility generator is for creating simple grids. It uses a CSS Grid with a custom property to update the grid columns, and provides a flexbox fallback for older browsers. It supports flexible values for number of columns in the grid, grid items spanning multiple columns, and breakpoints for both.
6
4
 
7
- The `spans` entry will output a class to instruct a grid item to span
8
- a specific number of columns. By default, grid items will each span
9
- a single column. Apply a trailing comma to the list of spans.
5
+ ## Available Classes
10
6
 
11
- To apply a grid to an element, i.e. an element's children, add the `pmc-a-grid`
12
- class to initiate a single column grid, then additional utility classes to
13
- adjust the grid e.g.
7
+ Reference the `$grids` list in packages/larva-css/src/02-algorithms/a-grid/a-grid.common.inline.scss to see which grids are available from Larva CSS.
14
8
 
15
- `<section class="pmc-a-grid pmc-a-cols2 pmc-a-cols4@desktop">`
9
+ ## Algorithm Source
16
10
 
17
- Similarly, each grid item should have the class `pmc-a-grid-item`. Span utilities
18
- can be added in a similar fashion:
11
+ Here is an example of the algorithm accommodating a two column grid that changes to four columns at desktop:
12
+ ```
13
+ .lrv-a-grid {
14
+ --cols: 1;
19
15
 
20
- `<div class="pmc-a-grid-item pmc-a-span2@tablet">`.
16
+ display: grid;
17
+ grid-gap: 1.25rem;
18
+ grid-template-columns: repeat( var( --cols ), minmax( 0, 1fr ) );
19
+ }
20
+
21
+ .lrv-a-cols2 {
22
+ --cols: 2;
23
+ }
24
+
25
+ @media( min-width: $screen-desktop ) {
26
+
27
+ .lrv-a-cols4\@desktop {
28
+ --cols: 4;
29
+ }
30
+
31
+ }
32
+ ```
33
+
34
+ ## Use in a project:
35
+
36
+ To add new grids in a project, create a-grid.{chunk}.inline.scss and add the following:
37
+
38
+ ```langauge-scss
39
+ $grids: (
40
+ (
41
+ columns: 4,
42
+ spans: ( 2, 3, ),
43
+ breakpoint: tablet,
44
+ ),
45
+ );
46
+
47
+ @include a-grid( $grids );
48
+ ```
49
+
50
+ This will output something like:
51
+
52
+ ```
53
+ @media min-width( ${TABLET} ) {
54
+
55
+ .a-cols4\@tablet {
56
+ --cols: 4;
57
+ }
58
+
59
+ .a-span\@tablet {
60
+ grid-column: span 2;
61
+ }
62
+
63
+ .a-span3\@tablet {
64
+ grid-column: span 3;
65
+ }
66
+ }
67
+ ```
68
+
69
+ `.lrv-a-cols4@tablet` must be applied along with `.lrv-a-grid` to set up the main part of the grid.
70
+
71
+ A few important things to note:
72
+
73
+ * In the mixin, **grids must be in order of media queries to maintain the cascade**, e.g. desktop-xl grids are at the very end, breakpoint-less grids at the top.
74
+ * By default, grid items will each span
75
+ a single column.
76
+ * Apply a trailing comma to the list of spans, and in general, use trailing commas in Sass lists.
77
+ * It is best practice to apply `lrv-a-grid-item` to child elements of an `a-grid` for both readability and a few edge cases, but note that some code-bases have not done this.
78
+
79
+ ## Examples
80
+
81
+ If mobile is two columns:
82
+ +----+----+
83
+ | | |
84
+ | | |
85
+ +---------+
86
+ | | |
87
+ | | |
88
+ +----+----+
89
+
90
+ And desktop is four columns:
91
+ +------+------+------+------+
92
+ | | | | |
93
+ | | | | |
94
+ +------+------+------+------+
95
+
96
+ The markup would be:
97
+
98
+ ```language-html
99
+ <div class="lrv-a-grid lrv-a-cols2 lrv-a-cols4@desktop">
100
+ <div class="lrv-a-grid-item"></div>
101
+ <div class="lrv-a-grid-item"></div>
102
+ <div class="lrv-a-grid-item"></div>
103
+ <div class="lrv-a-grid-item"></div>
104
+ </div>
105
+ ```
106
+
107
+ If mobile is one column:
108
+ +--------+
109
+ |////////|
110
+ |////////|
111
+ +--------+
112
+ | |
113
+ +--------+
114
+ | |
115
+ +--------+
116
+
117
+ And desktop is a four column grid, with the first element spanning two columns:
118
+ +------+------+------+------+
119
+ |/////////////| | |
120
+ |/////////////| | |
121
+ +------+------+------+------+
122
+
123
+ ```language-html
124
+ <div class="lrv-a-grid lrv-a-cols4@desktop">
125
+ <div class="lrv-a-grid-item lrv-a-span2@desktop"></div>
126
+ <div class="lrv-a-grid-item"></div>
127
+ <div class="lrv-a-grid-item"></div>
128
+ </div>
129
+ ```
130
+
131
+ ## Extendable?
132
+
133
+ **Do not extend `a-grid`**. Use utilities or create a separate algorithm.
134
+
135
+ The class name `a-grid` should _only_ be used for declarations that apply to this basic, equal column CSS grid, and that **does not include grid-gap**. Any adjustments in `grid-gap` or specific grid configurations beyond equal columns should be done with `u-grid` utilities.
136
+
137
+ For example, to apply a larger grid-gap to an `a-grid`, you could add this to `03-utilities/u-grid.{chunk}.inline.scss`:
138
+
139
+ ```
140
+ .u-grid-gap-2\@desktop {
141
+ @include pmc-breakpoint( desktop ) {
142
+ grid-gap: $spacer-2;
143
+ }
144
+ }
145
+ ```
146
+
147
+ And apply `u-grid-gap-2@desktop` to the same element as `lrv-a-grid`.
@@ -1,6 +1,6 @@
1
- @import '@penskemediacorp/larva-scss/dist/generators';
1
+ @import 'setup';
2
2
 
3
- .pmc-a-grid {
3
+ .lrv-a-grid {
4
4
  display: flex;
5
5
  flex-wrap: wrap;
6
6
  align-items: start;
@@ -14,8 +14,8 @@
14
14
  }
15
15
  }
16
16
 
17
- .pmc-a-grid-item {
18
- // Remove flex charactaristics to honor flex-basis value.
17
+ .lrv-a-grid-item {
18
+ // Remove flex characteristics to honor flex-basis value.
19
19
  flex: none;
20
20
  padding: 0.625rem;
21
21
 
@@ -33,10 +33,62 @@ $grids: (
33
33
  spans: ( 2 ),
34
34
  ),
35
35
  (
36
- columns: 4,
36
+ columns: 2,
37
+ breakpoint: tablet,
38
+ ),
39
+ (
40
+ columns: 3,
37
41
  spans: ( 2 ),
38
42
  breakpoint: tablet,
39
43
  ),
44
+ (
45
+ columns: 4,
46
+ spans: ( 2, 3, ),
47
+ breakpoint: tablet,
48
+ ),
49
+ (
50
+ columns: 3,
51
+ breakpoint: desktop,
52
+ ),
53
+ (
54
+ columns: 2,
55
+ breakpoint: desktop,
56
+ ),
57
+ (
58
+ columns: 2,
59
+ breakpoint: desktop-xl,
60
+ ),
61
+ (
62
+ columns: 4,
63
+ spans: ( 2 ),
64
+ breakpoint: desktop,
65
+ ),
66
+ (
67
+ columns: 4,
68
+ spans: ( 3 ),
69
+ breakpoint: desktop,
70
+ ),
71
+ (
72
+ columns: 4,
73
+ spans: ( 3 ),
74
+ breakpoint: desktop-xl,
75
+ ),
76
+ (
77
+ columns: 5,
78
+ breakpoint: desktop,
79
+ ),
40
80
  );
41
81
 
42
- @include pmc-a-grid( $grids );
82
+ @include a-grid( $grids, $NAMESPACE: 'lrv-' );
83
+
84
+ .lrv-a-grid-first-child-span-all\@mobile-max {
85
+
86
+ @include pmc-breakpoint( mobile-max ) {
87
+
88
+ & > *:first-child {
89
+ @supports ( display: grid ) {
90
+ grid-column: 1 / -1;
91
+ }
92
+ }
93
+ }
94
+ }
@@ -4,18 +4,18 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
- <link rel="stylesheet" href="./a-grid.critical.css">
7
+ <link rel="stylesheet" href="../../../build/css/algorithms.common.inline.css">
8
8
  <title>Document</title>
9
9
  </head>
10
10
  <body>
11
- <div class="pmc-a-grid pmc-a-cols2">
11
+ <div class="lrv-a-grid lrv-a-cols2">
12
12
  <div>Lorem ipsum dolor sit amet consectetur adipisicing elit. Totam omnis qui minima aperiam aspernatur distinctio nam neque nostrum nesciunt laborum? Ad dicta quam possimus voluptates velit perferendis vel sed itaque!</div>
13
13
  <div>Lorem ipsum dolor sit amet consectetur adipisicing elit. Totam omnis qui minima aperiam aspernatur distinctio nam neque nostrum nesciunt laborum? Ad dicta quam possimus voluptates velit perferendis vel sed itaque!</div>
14
14
  </div>
15
15
  <hr>
16
- <div class="pmc-a-grid pmc-a-cols3">
16
+ <div class="lrv-a-grid lrv-a-cols3">
17
17
  <div>Lorem ipsum dolor sit amet consectetur adipisicing elit. Totam omnis qui minima aperiam aspernatur distinctio nam neque nostrum nesciunt laborum? Ad dicta quam possimus voluptates velit perferendis vel sed itaque!</div>
18
- <div class="pmc-a-grid-item pmc-a-span2">Lorem ipsum dolor sit amet consectetur adipisicing elit. Totam omnis qui minima aperiam aspernatur distinctio nam neque nostrum nesciunt laborum? Ad dicta quam possimus voluptates velit perferendis vel sed itaque!</div>
18
+ <div class="lrv-a-grid-item lrv-a-span2">Lorem ipsum dolor sit amet consectetur adipisicing elit. Totam omnis qui minima aperiam aspernatur distinctio nam neque nostrum nesciunt laborum? Ad dicta quam possimus voluptates velit perferendis vel sed itaque!</div>
19
19
  </div>
20
20
  </body>
21
21
  </html>
@@ -0,0 +1,43 @@
1
+ @import 'setup';
2
+
3
+ @mixin _a-hidden {
4
+ // stylelint-disable declaration-no-important
5
+ display: none !important;
6
+ // stylelint-enable declaration-no-important
7
+ height: 0;
8
+ width: 0;
9
+ }
10
+
11
+ .lrv-a-hidden {
12
+ @include _a-hidden;
13
+ }
14
+
15
+ .lrv-a-hidden\@mobile-max {
16
+ @include pmc-breakpoint( mobile-max ) {
17
+ @include _a-hidden;
18
+ }
19
+ }
20
+
21
+ .lrv-a-hidden\@desktop-max {
22
+ @include pmc-breakpoint( desktop-max ) {
23
+ @include _a-hidden;
24
+ }
25
+ }
26
+
27
+ .lrv-a-hidden\@desktop-xl-max {
28
+ @include pmc-breakpoint( desktop-xl-max ) {
29
+ @include _a-hidden;
30
+ }
31
+ }
32
+
33
+ .lrv-a-hidden\@tablet {
34
+ @include pmc-breakpoint( tablet ) {
35
+ @include _a-hidden;
36
+ }
37
+ }
38
+
39
+ .lrv-a-hidden\@desktop {
40
+ @include pmc-breakpoint( desktop ) {
41
+ @include _a-hidden;
42
+ }
43
+ }
@@ -2,16 +2,16 @@
2
2
 
3
3
  @include pmc-breakpoint( tablet ) {
4
4
 
5
- .pmc-a-hover-dropup\@tablet {
5
+ .lrv-a-hover-dropup\@tablet {
6
6
  position: relative;
7
7
  min-width: 14rem;
8
8
  }
9
9
 
10
- .pmc-a-hover-dropup-trigger\@tablet {
10
+ .lrv-a-hover-dropup-trigger\@tablet {
11
11
  cursor: pointer;
12
12
  }
13
13
 
14
- .pmc-a-hover-dropup-target\@tablet {
14
+ .lrv-a-hover-dropup-target\@tablet {
15
15
  width: 100%;
16
16
  visibility: hidden;
17
17
  opacity: 0;
@@ -24,14 +24,15 @@
24
24
  max-height: 8.438rem;
25
25
  }
26
26
 
27
- .pmc-a-hover-dropup\@tablet:hover .pmc-a-hover-dropup-target\@tablet,
28
- .pmc-a-hover-dropup\@tablet:focus .pmc-a-hover-dropup-target\@tablet {
27
+ .lrv-a-hover-dropup\@tablet:hover .lrv-a-hover-dropup-target\@tablet,
28
+ .lrv-a-hover-dropup\@tablet:focus .lrv-a-hover-dropup-target\@tablet {
29
29
  visibility: visible;
30
30
  opacity: 1;
31
31
  }
32
-
33
- .pmc-a-hover-dropup\@tablet:hover .pmc-a-hover-dropup-trigger\@tablet::after,
34
- .pmc-a-hover-dropup\@tablet:focus .pmc-a-hover-dropup-target\@tablet {
32
+
33
+ // Transform a-icon
34
+ .lrv-a-hover-dropup\@tablet:hover .lrv-a-icon-arrow-down::after,
35
+ .lrv-a-hover-dropup\@tablet:focus .lrv-a-icon-arrow-down {
35
36
  --a-icon-transform: rotate(180deg);
36
37
  }
37
38
  }
@@ -9,9 +9,9 @@
9
9
  </head>
10
10
  <body>
11
11
  <div style="height:300px"></div>
12
- <div class="pmc-a-hover-dropup@tablet">
13
- <div class="pmc-a-hover-dropup-trigger@tablet">Hover me to show the list above</div>
14
- <div class="pmc-a-hover-dropup-target@tablet">
12
+ <div class="lrv-a-hover-dropup@tablet">
13
+ <div class="lrv-a-hover-dropup-trigger@tablet">Hover me to show the list above</div>
14
+ <div class="lrv-a-hover-dropup-target@tablet">
15
15
  <ul>
16
16
  <li>List item 1</li>
17
17
  <li>List item 2</li>
@@ -0,0 +1,25 @@
1
+ @import 'setup';
2
+
3
+ .lrv-a-hover-effect {
4
+ transition: var( --a-hover-effect-property, $transition-hover );
5
+ }
6
+
7
+ .lrv-a-hover-effect--fade {
8
+ transform: translate3d( 0px, 0px, 0px ); // stylelint-disable-line unit-disallowed-list
9
+ }
10
+
11
+ .lrv-a-hover-effect--fade:hover {
12
+ --a-hover-effect-property: opacity;
13
+
14
+ opacity: 0.5;
15
+ }
16
+
17
+ .lrv-a-hover-effect--underline {
18
+ transform: translate3d( 0px, 0px, 0px ); // stylelint-disable-line unit-disallowed-list
19
+ }
20
+
21
+ .lrv-a-hover-effect--underline:hover {
22
+ --a-hover-effect-property: border-bottom;
23
+
24
+ border-bottom: 1px solid currentColor;
25
+ }
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
+ <title>Document</title>
8
+ <link rel="stylesheet" href="../../../build/css/algorithms.common.async.css">
9
+ <link rel="stylesheet" href="../../../build/css/utilities.common.inline.css">
10
+ </head>
11
+ <body>
12
+ <div class="lrv-a-hover-effect lrv-a-hover-effect--fade lrv-u-display-inline-block">
13
+ <img src="http://placehold.it/300x300" alt="">
14
+ </div>
15
+ </body>
16
+ </html>
@@ -0,0 +1,36 @@
1
+ @import 'setup';
2
+
3
+ .lrv-a-icon-after-remove\@tablet::after {
4
+ @include pmc-breakpoint( tablet ) {
5
+ display: none;
6
+ }
7
+ }
8
+
9
+ .lrv-a-icon-invert {
10
+ --a-icon-filter: invert(1);
11
+ }
12
+
13
+ .lrv-a-icon-arrow-left,
14
+ .lrv-a-icon-arrow-right,
15
+ .lrv-a-icon-arrow-down,
16
+ .lrv-a-icon-arrow-up {
17
+ --a-icon-url: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 8'%3E%3Cpath d='M13.7 1.7l-6 6c-.2.2-.4.3-.7.3-.3 0-.5-.1-.7-.3l-6-6C-.1 1.3-.1.7.3.3s1-.4 1.4 0L7 5.6 12.3.3c.4-.4 1-.4 1.4 0s.4 1 0 1.4z'/%3E%3C/svg%3E" );
18
+ --a-icon-height: #{ $font-size-12 };
19
+ }
20
+
21
+ .lrv-a-icon-arrow-right {
22
+ --a-icon-transform: rotate(-90deg);
23
+ }
24
+
25
+ .lrv-a-icon-arrow-left {
26
+ --a-icon-transform: rotate(90deg);
27
+ }
28
+
29
+ .lrv-a-icon-envelope {
30
+ --a-icon-url: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M.77.945C.636.875.406.752.356.605.269.357.362.258.731.258h12.723c.37 0 .462.096.376.349-.05.143-.28.27-.416.34-.366.192-5.45 2.964-5.64 3.064-.19.1-.382.146-.681.146-.3 0-.493-.047-.683-.146C6.22 3.91 1.137 1.138.77.945zm12.934.15c.296-.15.276.023.276.163v6.82c0 .307-.39.696-.716.696H.921c-.326 0-.782-.386-.782-.695V1.258c0-.136.016-.313.31-.163.272.14 2.747 1.883 4.368 2.931L2.085 7.104c-.066.066-.096.15-.056.186.04.04.13.02.196-.046l3.28-2.769c.496.32.842.54.905.573.257.13.436.146.683.146.246 0 .425-.017.682-.146.06-.034.409-.253.905-.573l3.28 2.769c.07.063.156.083.196.046.037-.04.007-.12-.06-.186L9.363 4.026c1.62-1.048 4.069-2.791 4.342-2.931z'/%3E%3C/svg%3E" );
31
+ --a-icon-height: #{ $font-size-10 };
32
+ }
33
+
34
+ .lrv-a-icon-search {
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
+ }
@@ -1,16 +1,15 @@
1
- @import '@penskemediacorp/larva-scss/dist/tokens';
2
- @import '@penskemediacorp/larva-scss/dist/tools';
3
-
4
- $ICONS_BUILD_PATH: '/icons';
1
+ @import 'setup';
5
2
 
6
3
  @mixin _a-icon-base {
7
4
  content: var(--a-icon-content, '');
5
+ filter: var(--a-icon-filter, none);
8
6
  background-image: var(--a-icon-url, '');
9
7
  background-repeat: no-repeat;
10
8
  background-size: contain;
11
9
  height: var(--a-icon-height, #{ $spacer-1 });
12
10
  width: var(--a-icon-width, #{ $spacer-1 });
13
11
  transform: var( --a-icon-transform, none );
12
+ flex-shrink: 0;
14
13
  }
15
14
 
16
15
  @mixin _a-icon-base-pseudo( $pseudo-el ) {
@@ -30,7 +29,7 @@ $ICONS_BUILD_PATH: '/icons';
30
29
  height: initial;
31
30
  width: initial;
32
31
  // background okay for reset.
33
- background: initial; // stylelint-disable-line property-blacklist
32
+ background: initial; // stylelint-disable-line property-disallowed-list
34
33
  font-size: inherit;
35
34
  color: currentColor;
36
35
  margin: 0;
@@ -39,97 +38,84 @@ $ICONS_BUILD_PATH: '/icons';
39
38
  }
40
39
  }
41
40
 
42
- .a-icon {
41
+ .lrv-a-icon {
43
42
  @include _a-icon-base();
44
43
  }
45
44
 
46
- .a-icon-before {
45
+ .lrv-a-icon-before {
47
46
  @include _a-icon-base-pseudo( before ) {
48
47
  margin-right: $spacer-050;
49
48
  }
50
49
  }
51
50
 
52
- .a-icon-after {
51
+ .lrv-a-icon-after {
53
52
  @include _a-icon-base-pseudo( after ) {
54
53
  margin-left: $spacer-050;
55
54
  }
56
55
  }
57
56
 
58
- .a-icon-after\:margin-l-auto::after {
57
+ .lrv-a-icon-after\:margin-l-auto::after {
59
58
  margin-left: auto;
60
59
  }
61
60
 
62
61
  // Specific Icons
63
62
 
64
- .a-icon-arrow-left,
65
- .a-icon-arrow-right,
66
- .a-icon-arrow-down,
67
- .a-icon-arrow-up {
68
- --a-icon-url: url( #{$ICONS_BUILD_PATH + '/stack/svg/sprite.stack.svg#arrow'} );
69
- --a-icon-height: #{ $font-size-12 };
70
- }
63
+ .lrv-a-icon-forward-slash,
64
+ .lrv-a-icon-bullet,
65
+ .lrv-a-icon-vertical-pipe {
66
+ @include _a-icon-reset( before ) {
67
+ padding-right: $spacer-050;
68
+ };
71
69
 
72
- .a-icon-arrow-right {
73
- --a-icon-transform: rotate(-90deg);
70
+ @include _a-icon-reset( after ) {
71
+ padding-left: $spacer-025;
72
+ };
74
73
  }
75
74
 
76
- .a-icon-arrow-left {
77
- --a-icon-transform: rotate(90deg);
75
+ .lrv-a-icon-forward-slash {
76
+ --a-icon-content: '/';
78
77
  }
79
78
 
80
- .a-icon-envelope {
81
- --a-icon-url: url( #{$ICONS_BUILD_PATH + '/stack/svg/sprite.stack.svg#envelope'} );
79
+ .lrv-a-icon-bullet {
80
+ --a-icon-content: '\02022';
82
81
  }
83
82
 
84
- .a-icon-forward-slash {
85
- --a-icon-content: '/';
83
+ .lrv-a-icon-vertical-pipe {
84
+ --a-icon-content: '\007C';
85
+ padding-right: $spacer-025;
86
+ }
86
87
 
87
- @include _a-icon-reset( before ) {
88
- padding-right: $spacer-050;
89
- };
88
+ .lrv-a-icon-after-arrow-top-left {
89
+ &::before {
90
+ position: absolute;
91
+ content: '';
92
+ display: block;
93
+ width: pmc-rem(24);
94
+ height: pmc-rem(24);
95
+ left: 13%;
96
+ border: 2px solid map-get( $TOKENS-MAP, color-black );
97
+ border-right-color: transparent;
98
+ border-bottom-color: transparent;
99
+ transform: rotate( 45deg );
100
+ top: pmc-rem(-12);
101
+ background-color: $color-white;
102
+ }
103
+ }
90
104
 
91
- @include _a-icon-reset( after ) {
92
- padding-left: $spacer-025;
93
- };
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
+ }
94
120
  }
95
121
 
96
- // // ----------
97
- // // Special Instance for Footer Dropdown Toggle Arrow
98
- // // ----------
99
-
100
- // // @TODO: Move a-icon-after-down to one-offs or an algorithm called a-border-icon / a-toggle-icon.
101
- // .a-icon-after-down {
102
- // position: relative;
103
- // display: flex;
104
- // align-items: center;
105
- // flex-wrap: nowrap;
106
- // padding-right: $spacer-025;
107
-
108
- // &::after {
109
- // content: '';
110
- // margin-left: auto;
111
- // width: 0.75rem;
112
- // height: 0.75rem;
113
- // transform: scaleY(0.85) translate(-50%,-50%) rotate(45deg);
114
- // border: 0.125rem solid;
115
- // border-left: none;
116
- // border-top: none;
117
- // transition: transform 225ms cubic-bezier(0.4,0,0.2,1);
118
- // }
119
- // }
120
-
121
- // .a-icon-after-down-hide\@mobile {
122
- // @include breakpoint( mobile ) {
123
- // display: block;
124
-
125
- // &::after {
126
- // display: none;
127
- // }
128
- // }
129
- // }
130
-
131
- // .a-icon-after-down--has-toggle {
132
- // &::after {
133
- // transform: scaleY(-0.85) translate(-50%,25%) rotate(45deg);
134
- // }
135
- // }
@@ -0,0 +1,30 @@
1
+ @import '@penskemediacorp/larva-scss/dist/tools';
2
+
3
+ @mixin _a-screen-reader-only-base {
4
+ border: 0;
5
+ clip: rect(1px, 1px, 1px, 1px); // stylelint-disable-line unit-disallowed-list
6
+ clip-path: inset(50%);
7
+ height: 1px; // stylelint-disable-line unit-disallowed-list
8
+ margin: -1px; // stylelint-disable-line unit-disallowed-list
9
+ overflow: hidden;
10
+ padding: 0;
11
+ position: absolute;
12
+ width: 1px; // stylelint-disable-line unit-disallowed-list
13
+ word-wrap: normal;
14
+ }
15
+
16
+ .lrv-a-screen-reader-only {
17
+ @include _a-screen-reader-only-base;
18
+ }
19
+
20
+ .lrv-a-screen-reader-only\@mobile-max {
21
+ @include pmc-breakpoint( mobile-max ) {
22
+ @include _a-screen-reader-only-base();
23
+ }
24
+ }
25
+
26
+ .lrv-a-screen-reader-only\@desktop-xl {
27
+ @include pmc-breakpoint( desktop-xl ) {
28
+ @include _a-screen-reader-only-base();
29
+ }
30
+ }