@transferwise/neptune-css 0.0.0-experimental-1181467

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 (180) hide show
  1. package/LICENSE.md +13 -0
  2. package/README.md +45 -0
  3. package/dist/css/accordion.css +1 -0
  4. package/dist/css/alerts.css +1 -0
  5. package/dist/css/background.css +1 -0
  6. package/dist/css/badge.css +1 -0
  7. package/dist/css/border-radius.css +1 -0
  8. package/dist/css/breadcrumbs.css +1 -0
  9. package/dist/css/button-groups.css +1 -0
  10. package/dist/css/buttons.css +1 -0
  11. package/dist/css/chevron.css +1 -0
  12. package/dist/css/circles.css +1 -0
  13. package/dist/css/close.css +1 -0
  14. package/dist/css/column-layout.css +1 -0
  15. package/dist/css/currency-flags.css +1 -0
  16. package/dist/css/decision.css +1 -0
  17. package/dist/css/dropdowns.css +1 -0
  18. package/dist/css/droppable.css +1 -0
  19. package/dist/css/flex.css +1 -0
  20. package/dist/css/footer.css +1 -0
  21. package/dist/css/grid.css +1 -0
  22. package/dist/css/input-groups.css +1 -0
  23. package/dist/css/link-callout.css +1 -0
  24. package/dist/css/list-group.css +1 -0
  25. package/dist/css/loaders.css +1 -0
  26. package/dist/css/media.css +1 -0
  27. package/dist/css/modals.css +1 -0
  28. package/dist/css/navbar-base.css +1 -0
  29. package/dist/css/navbar.css +1 -0
  30. package/dist/css/navs.css +1 -0
  31. package/dist/css/neptune-addons.css +1 -0
  32. package/dist/css/neptune-core.css +1 -0
  33. package/dist/css/neptune-social-media.css +1 -0
  34. package/dist/css/neptune.css +1 -0
  35. package/dist/css/panels.css +1 -0
  36. package/dist/css/popovers.css +1 -0
  37. package/dist/css/process.css +1 -0
  38. package/dist/css/progress-bars.css +1 -0
  39. package/dist/css/ring.css +1 -0
  40. package/dist/css/select.css +1 -0
  41. package/dist/css/sequences.css +1 -0
  42. package/dist/css/table.css +1 -0
  43. package/dist/css/tick.css +1 -0
  44. package/dist/css/tooltip.css +1 -0
  45. package/dist/css/utilities.css +1 -0
  46. package/dist/css/wells.css +1 -0
  47. package/dist/fonts/TW-Averta-Bold.woff +0 -0
  48. package/dist/fonts/TW-Averta-Bold.woff2 +0 -0
  49. package/dist/fonts/TW-Averta-Regular.woff +0 -0
  50. package/dist/fonts/TW-Averta-Regular.woff2 +0 -0
  51. package/dist/fonts/TW-Averta-Semibold.woff +0 -0
  52. package/dist/fonts/TW-Averta-Semibold.woff2 +0 -0
  53. package/dist/fonts/TransferWise-IconFont.svg +81 -0
  54. package/dist/fonts/TransferWise-IconFont.woff +0 -0
  55. package/dist/fonts/WorldwiseSans-Heavy.woff2 +0 -0
  56. package/dist/fonts/inter-cyrillic-ext-variable-wghtOnly-normal.woff2 +0 -0
  57. package/dist/fonts/inter-cyrillic-variable-wghtOnly-normal.woff2 +0 -0
  58. package/dist/fonts/inter-greek-ext-variable-wghtOnly-normal.woff2 +0 -0
  59. package/dist/fonts/inter-greek-variable-wghtOnly-normal.woff2 +0 -0
  60. package/dist/fonts/inter-latin-ext-variable-wghtOnly-normal.woff2 +0 -0
  61. package/dist/fonts/inter-latin-variable-wghtOnly-normal.woff2 +0 -0
  62. package/dist/fonts/inter-vietnamese-variable-wghtOnly-normal.woff2 +0 -0
  63. package/dist/img/bg-dark.svg +31 -0
  64. package/dist/img/bg-light.svg +26 -0
  65. package/dist/less/legacy-variables.less +1299 -0
  66. package/dist/less/neptune-tokens.less +272 -0
  67. package/dist/less/zindex.less +17 -0
  68. package/dist/props/custom-media.css +9 -0
  69. package/dist/props/legacy-custom-props.css +69 -0
  70. package/dist/props/neptune-tokens.css +150 -0
  71. package/package.json +59 -0
  72. package/scripts/neptune-css-upgrader.js +106 -0
  73. package/src/fonts/TW-Averta-Bold.woff +0 -0
  74. package/src/fonts/TW-Averta-Bold.woff2 +0 -0
  75. package/src/fonts/TW-Averta-Regular.woff +0 -0
  76. package/src/fonts/TW-Averta-Regular.woff2 +0 -0
  77. package/src/fonts/TW-Averta-Semibold.woff +0 -0
  78. package/src/fonts/TW-Averta-Semibold.woff2 +0 -0
  79. package/src/fonts/TransferWise-IconFont.svg +81 -0
  80. package/src/fonts/TransferWise-IconFont.woff +0 -0
  81. package/src/fonts/WorldwiseSans-Heavy.woff2 +0 -0
  82. package/src/fonts/inter-cyrillic-ext-variable-wghtOnly-normal.woff2 +0 -0
  83. package/src/fonts/inter-cyrillic-variable-wghtOnly-normal.woff2 +0 -0
  84. package/src/fonts/inter-greek-ext-variable-wghtOnly-normal.woff2 +0 -0
  85. package/src/fonts/inter-greek-variable-wghtOnly-normal.woff2 +0 -0
  86. package/src/fonts/inter-latin-ext-variable-wghtOnly-normal.woff2 +0 -0
  87. package/src/fonts/inter-latin-variable-wghtOnly-normal.woff2 +0 -0
  88. package/src/fonts/inter-vietnamese-variable-wghtOnly-normal.woff2 +0 -0
  89. package/src/img/bg-dark.svg +31 -0
  90. package/src/img/bg-light.svg +26 -0
  91. package/src/less/accordion.less +15 -0
  92. package/src/less/addons/_background-utilities.less +82 -0
  93. package/src/less/addons/_border.less +3 -0
  94. package/src/less/addons/_display-utilities.less +159 -0
  95. package/src/less/addons/_spacing-utilities.less +49 -0
  96. package/src/less/addons/_utilities.less +147 -0
  97. package/src/less/alerts.less +253 -0
  98. package/src/less/background.less +24 -0
  99. package/src/less/badge.less +85 -0
  100. package/src/less/border-radius.less +3 -0
  101. package/src/less/breadcrumbs.less +27 -0
  102. package/src/less/button-groups.less +424 -0
  103. package/src/less/buttons.less +714 -0
  104. package/src/less/chevron.less +39 -0
  105. package/src/less/circles.less +223 -0
  106. package/src/less/close.less +48 -0
  107. package/src/less/column-layout.less +167 -0
  108. package/src/less/components/_component-animations.less +43 -0
  109. package/src/less/core/_fonts.less +97 -0
  110. package/src/less/core/_scaffolding.less +473 -0
  111. package/src/less/core/_typography-utilities.less +269 -0
  112. package/src/less/core/_typography.less +794 -0
  113. package/src/less/currency-flags.less +41 -0
  114. package/src/less/decision.less +98 -0
  115. package/src/less/dropdowns.less +374 -0
  116. package/src/less/droppable.less +280 -0
  117. package/src/less/flex.less +113 -0
  118. package/src/less/footer.less +113 -0
  119. package/src/less/forms/bootstrap-forms.less +1227 -0
  120. package/src/less/forms/checkbox-radio.less +303 -0
  121. package/src/less/grid.less +187 -0
  122. package/src/less/input-groups.less +299 -0
  123. package/src/less/link-callout.less +17 -0
  124. package/src/less/list-group.less +260 -0
  125. package/src/less/loaders.less +91 -0
  126. package/src/less/media.less +61 -0
  127. package/src/less/mixins/_alerts.less +35 -0
  128. package/src/less/mixins/_arrows.less +52 -0
  129. package/src/less/mixins/_border-radius.less +11 -0
  130. package/src/less/mixins/_buttons.less +82 -0
  131. package/src/less/mixins/_center-block.less +7 -0
  132. package/src/less/mixins/_circle.less +11 -0
  133. package/src/less/mixins/_clearfix.less +23 -0
  134. package/src/less/mixins/_flex.less +105 -0
  135. package/src/less/mixins/_forms.less +128 -0
  136. package/src/less/mixins/_grid-framework.less +104 -0
  137. package/src/less/mixins/_grid.less +158 -0
  138. package/src/less/mixins/_hide-text.less +20 -0
  139. package/src/less/mixins/_links.less +7 -0
  140. package/src/less/mixins/_list-group.less +23 -0
  141. package/src/less/mixins/_logical-properties-IE-friendly.less +381 -0
  142. package/src/less/mixins/_logical-properties-modern-browsers.less +226 -0
  143. package/src/less/mixins/_logical-properties.less +5 -0
  144. package/src/less/mixins/_nav-vertical-align.less +10 -0
  145. package/src/less/mixins/_panels.less +23 -0
  146. package/src/less/mixins/_physical-properties.less +110 -0
  147. package/src/less/mixins/_reset-text.less +22 -0
  148. package/src/less/mixins/_sequence.less +203 -0
  149. package/src/less/mixins/_spacing.less +122 -0
  150. package/src/less/mixins/_tab-focus.less +5 -0
  151. package/src/less/mixins/_table-row.less +47 -0
  152. package/src/less/mixins/_text-emphasis.less +39 -0
  153. package/src/less/mixins/_theming.less +7 -0
  154. package/src/less/modals.less +239 -0
  155. package/src/less/navbar-base.less +1333 -0
  156. package/src/less/navbar.less +106 -0
  157. package/src/less/navs.less +341 -0
  158. package/src/less/neptune-addons.less +4 -0
  159. package/src/less/neptune-core.less +4 -0
  160. package/src/less/neptune-social-media.less +57 -0
  161. package/src/less/neptune.bundle.less +44 -0
  162. package/src/less/panels.less +410 -0
  163. package/src/less/popovers.less +381 -0
  164. package/src/less/process.less +395 -0
  165. package/src/less/progress-bars.less +70 -0
  166. package/src/less/ring.less +51 -0
  167. package/src/less/select.less +88 -0
  168. package/src/less/sequences.less +515 -0
  169. package/src/less/table.less +385 -0
  170. package/src/less/tick.less +37 -0
  171. package/src/less/tooltip.less +132 -0
  172. package/src/less/utilities.less +153 -0
  173. package/src/less/wells.less +37 -0
  174. package/src/props/custom-media.css +9 -0
  175. package/src/props/legacy-custom-props.css +69 -0
  176. package/src/props/neptune-tokens.css +11 -0
  177. package/src/variables/legacy-variables.less +1299 -0
  178. package/src/variables/neptune-tokens.less +12 -0
  179. package/src/variables/zindex.less +17 -0
  180. package/upgrades/scripts/2021-11-v11-v12.js +61 -0
@@ -0,0 +1,158 @@
1
+ // Grid system
2
+ //
3
+ // Generate semantic grid columns with these mixins.
4
+
5
+ // Centered container element
6
+ .container-fixed(@gutter: @grid-gutter-width) {
7
+ margin-right: auto;
8
+ margin-left: auto;
9
+ padding-left: (@gutter / 2);
10
+ padding-right: (@gutter / 2);
11
+
12
+ &:extend(.clearfix all);
13
+ }
14
+
15
+ // Creates a wrapper for a series of columns
16
+ .make-row(@gutter: @grid-gutter-width) {
17
+ .margin(left, ceil((@gutter / -2)), floor((@gutter / -2)));
18
+
19
+ .margin(right, floor((@gutter / -2)), ceil((@gutter / -2)));
20
+
21
+ &:extend(.clearfix all);
22
+ }
23
+
24
+ // Generate the extra small columns
25
+ .make-xs-column(@columns; @gutter: @grid-gutter-width) {
26
+ position: relative;
27
+ .float(left);
28
+
29
+ width: percentage((@columns / @grid-columns));
30
+ min-height: 1px;
31
+ padding-left: (@gutter / 2);
32
+ padding-right: (@gutter / 2);
33
+ }
34
+ .make-xs-column-offset(@columns) {
35
+ .margin(left, percentage((@columns / @grid-columns)));
36
+ }
37
+ .make-xs-column-push(@columns) {
38
+ .left(percentage((@columns / @grid-columns)));
39
+ }
40
+ .make-xs-column-pull(@columns) {
41
+ .right(percentage((@columns / @grid-columns)));
42
+ }
43
+
44
+ // Generate the small columns
45
+ .make-sm-column(@columns; @gutter: @grid-gutter-width) {
46
+ position: relative;
47
+ min-height: 1px;
48
+ padding-left: (@gutter / 2);
49
+ padding-right: (@gutter / 2);
50
+
51
+ @media (min-width: @screen-sm-min) {
52
+ .float(left);
53
+
54
+ width: percentage((@columns / @grid-columns));
55
+ }
56
+ }
57
+ .make-sm-column-offset(@columns) {
58
+ @media (min-width: @screen-sm-min) {
59
+ .margin(left, percentage((@columns / @grid-columns)));
60
+ }
61
+ }
62
+ .make-sm-column-push(@columns) {
63
+ @media (min-width: @screen-sm-min) {
64
+ .left(percentage((@columns / @grid-columns)));
65
+ }
66
+ }
67
+ .make-sm-column-pull(@columns) {
68
+ @media (min-width: @screen-sm-min) {
69
+ .right(percentage((@columns / @grid-columns)));
70
+ }
71
+ }
72
+
73
+ // Generate the medium columns
74
+ .make-md-column(@columns; @gutter: @grid-gutter-width) {
75
+ position: relative;
76
+ min-height: 1px;
77
+ padding-left: (@gutter / 2);
78
+ padding-right: (@gutter / 2);
79
+
80
+ @media (min-width: @screen-md-min) {
81
+ .float(left);
82
+
83
+ width: percentage((@columns / @grid-columns));
84
+ }
85
+ }
86
+ .make-md-column-offset(@columns) {
87
+ @media (min-width: @screen-md-min) {
88
+ .margin(left, percentage((@columns / @grid-columns)));
89
+ }
90
+ }
91
+ .make-md-column-push(@columns) {
92
+ @media (min-width: @screen-md-min) {
93
+ .left(percentage((@columns / @grid-columns)));
94
+ }
95
+ }
96
+ .make-md-column-pull(@columns) {
97
+ @media (min-width: @screen-md-min) {
98
+ .right(percentage((@columns / @grid-columns)));
99
+ }
100
+ }
101
+
102
+ // Generate the large columns
103
+ .make-lg-column(@columns; @gutter: @grid-gutter-width) {
104
+ position: relative;
105
+ min-height: 1px;
106
+ padding-left: (@gutter / 2);
107
+ padding-right: (@gutter / 2);
108
+
109
+ @media (min-width: @screen-lg-min) {
110
+ .float(left);
111
+
112
+ width: percentage((@columns / @grid-columns));
113
+ }
114
+ }
115
+ .make-lg-column-offset(@columns) {
116
+ @media (min-width: @screen-lg-min) {
117
+ .margin(left, percentage((@columns / @grid-columns)));
118
+ }
119
+ }
120
+ .make-lg-column-push(@columns) {
121
+ @media (min-width: @screen-lg-min) {
122
+ .left(percentage((@columns / @grid-columns)));
123
+ }
124
+ }
125
+ .make-lg-column-pull(@columns) {
126
+ @media (min-width: @screen-lg-min) {
127
+ .right(percentage((@columns / @grid-columns)));
128
+ }
129
+ }
130
+
131
+ // Generate the large columns
132
+ .make-xl-column(@columns; @gutter: @grid-gutter-width) {
133
+ position: relative;
134
+ min-height: 1px;
135
+ padding-left: (@gutter / 2);
136
+ padding-right: (@gutter / 2);
137
+
138
+ @media (min-width: @screen-xl-min) {
139
+ .float(left);
140
+
141
+ width: percentage((@columns / @grid-columns));
142
+ }
143
+ }
144
+ .make-xl-column-offset(@columns) {
145
+ @media (min-width: @screen-xl-min) {
146
+ .margin(left, percentage((@columns / @grid-columns)));
147
+ }
148
+ }
149
+ .make-xl-column-push(@columns) {
150
+ @media (min-width: @screen-xl-min) {
151
+ .left(percentage((@columns / @grid-columns)));
152
+ }
153
+ }
154
+ .make-xl-column-pull(@columns) {
155
+ @media (min-width: @screen-xl-min) {
156
+ .right(percentage((@columns / @grid-columns)));
157
+ }
158
+ }
@@ -0,0 +1,20 @@
1
+ // CSS image replacement
2
+ //
3
+ // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for
4
+ // mixins being reused as classes with the same name, this doesn't hold up. As
5
+ // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`.
6
+ //
7
+ // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
8
+
9
+ // Deprecated as of v3.0.1 (will be removed in v4)
10
+ .hide-text() {
11
+ color: transparent;
12
+ text-shadow: none;
13
+ background-color: transparent;
14
+ border: 0;
15
+ }
16
+
17
+ // New mixin to use as of v3.0.1
18
+ .text-hide() {
19
+ .hide-text();
20
+ }
@@ -0,0 +1,7 @@
1
+ .link-underline (@isUnderlineImportant: false) {
2
+ text-decoration: underline;
3
+ & when (@isUnderlineImportant = true) {
4
+ text-decoration: underline !important;
5
+ }
6
+ text-underline-offset: 0.3em;
7
+ }
@@ -0,0 +1,23 @@
1
+ @import (reference) "_logical-properties.less";
2
+
3
+ .list-group-item-variant(@state; @background; @color) {
4
+ .list-group-item-@{state} {
5
+ .border(left, 3px, solid, @color);
6
+
7
+ .list-group-item& {
8
+ background-color: var(--color-background-screen);
9
+ }
10
+
11
+ .list-group-item-text {
12
+ color: @color;
13
+ }
14
+
15
+ a& {
16
+ color: @color;
17
+
18
+ &:hover {
19
+ color: @color;
20
+ }
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,381 @@
1
+ // Mixin to support Logical properties/values for IE
2
+
3
+ // CSS property: float: Flow-relative values inline-start
4
+ // and inline-end: https://caniuse.com/mdn-css_properties_float_flow_relative_values
5
+
6
+ .float(@direction) {
7
+ & when (@direction = left) {
8
+ [dir="rtl"] & {
9
+ float: right;
10
+ }
11
+
12
+ float: @direction;
13
+ }
14
+
15
+ & when (@direction = right) {
16
+ [dir="rtl"] & {
17
+ float: left;
18
+ }
19
+
20
+ float: @direction;
21
+ }
22
+ }
23
+
24
+ // CSS property: clear: Flow-relative values inline-start
25
+ // and inline-end: https://caniuse.com/mdn-css_properties_clear_flow_relative_values
26
+
27
+ .clear(@direction) {
28
+ & when (@direction = left) {
29
+ [dir="rtl"] & {
30
+ clear: right;
31
+ }
32
+
33
+ clear: @direction;
34
+ }
35
+
36
+ & when (@direction = right) {
37
+ [dir="rtl"] & {
38
+ clear: left;
39
+ }
40
+
41
+ clear: @direction;
42
+ }
43
+ }
44
+
45
+ // CSS property: text-align: Flow-relative values start
46
+ // and end: https://caniuse.com/mdn-css_properties_text-align_flow_relative_values_start_and_end
47
+
48
+ .text-align(@direction) {
49
+ & when (@direction = left) {
50
+ [dir="rtl"] & {
51
+ text-align: right;
52
+ }
53
+
54
+ text-align: left;
55
+ }
56
+
57
+ & when (@direction = right) {
58
+ [dir="rtl"] & {
59
+ text-align: left;
60
+ }
61
+
62
+ text-align: right;
63
+ }
64
+ }
65
+
66
+ // CSS Logical Properties: https://caniuse.com/css-logical-props
67
+
68
+ .padding(@direction, @currentDirectionPaddingValue, @oppositeDirectionPaddingValue: initial) {
69
+ & when (@direction = left) {
70
+ [dir="rtl"] & {
71
+ padding-right: @currentDirectionPaddingValue;
72
+ padding-@{direction}: @oppositeDirectionPaddingValue;
73
+ }
74
+
75
+ padding-@{direction}: @currentDirectionPaddingValue;
76
+ }
77
+
78
+ & when (@direction = right) {
79
+ [dir="rtl"] & {
80
+ padding-left: @currentDirectionPaddingValue;
81
+ padding-@{direction}: @oppositeDirectionPaddingValue;
82
+ }
83
+
84
+ padding-@{direction}: @currentDirectionPaddingValue;
85
+ }
86
+ }
87
+
88
+ .padding-for-spacing(@direction, @value) {
89
+ & when (@direction = left) {
90
+ [dir="rtl"] & {
91
+ padding-right: @value;
92
+ }
93
+
94
+ html:not([dir="rtl"]) & {
95
+ padding-@{direction}: @value;
96
+ }
97
+ }
98
+
99
+ & when (@direction = right) {
100
+ [dir="rtl"] & {
101
+ padding-left: @value;
102
+ }
103
+
104
+ html:not([dir="rtl"]) & {
105
+ padding-@{direction}: @value;
106
+ }
107
+ }
108
+ }
109
+
110
+ // Use only if the right and left values are different or you have to step up specificity of the padding.
111
+ // Use for single value shorthand
112
+ // 'padding: var(--foo);' -> '.padding-shorthand(var(--foo))'
113
+ // Use for multiple value shorthand
114
+ // 'padding: var(--foo1) var(--foo2) var(--foo3) var(--foo4);' ->
115
+ // '.padding-shorthand(var(--foo1), var(--foo2), var(--foo3), var(--foo4))'
116
+
117
+ .padding-shorthand(@value1, @value2: ~'', @value3: ~'', @value4: ~'') {
118
+ [dir="rtl"] & {
119
+ padding: @value1 @value4 @value3 @value2;
120
+ }
121
+
122
+ padding: @value1 @value2 @value3 @value4;
123
+ }
124
+
125
+ // CSS Logical Properties: https://caniuse.com/css-logical-props
126
+
127
+ .margin(@direction, @currentDirectionMarginValue, @oppositeDirectionMarginValue: initial) {
128
+ & when (@direction = left) {
129
+ [dir="rtl"] & {
130
+ margin-right: @currentDirectionMarginValue;
131
+ margin-@{direction}: @oppositeDirectionMarginValue;
132
+ }
133
+
134
+ margin-@{direction}: @currentDirectionMarginValue;
135
+ }
136
+
137
+ & when (@direction = right) {
138
+ [dir="rtl"] & {
139
+ margin-left: @currentDirectionMarginValue;
140
+ margin-@{direction}: @oppositeDirectionMarginValue;
141
+ }
142
+
143
+ margin-@{direction}: @currentDirectionMarginValue;
144
+ }
145
+ }
146
+
147
+ .margin-for-spacing(@direction, @value) {
148
+ & when (@direction = left) {
149
+ [dir="rtl"] & {
150
+ margin-right: @value;
151
+ }
152
+
153
+ html:not([dir="rtl"]) & {
154
+ margin-@{direction}: @value;
155
+ }
156
+ }
157
+
158
+ & when (@direction = right) {
159
+ [dir="rtl"] & {
160
+ margin-left: @value;
161
+ }
162
+
163
+ html:not([dir="rtl"]) & {
164
+ margin-@{direction}: @value;
165
+ }
166
+ }
167
+ }
168
+
169
+ // Use only if the right and left values are different or you have to step up specificity of the margin.
170
+ // Use for single value shorthand 'margin: var(--foo);' -> '.margin-shorthand(var(--foo))'
171
+ // Use for multiple value shorthand
172
+ // 'margin: var(--foo1) var(--foo2) var(--foo3) var(--foo4);' ->
173
+ // '.margin-shorthand(var(--foo1), var(--foo2), var(--foo3), var(--foo4))'
174
+
175
+ .margin-shorthand(@value1, @value2: ~'', @value3: ~'', @value4: ~'') {
176
+ [dir="rtl"] & {
177
+ margin: @value1 @value4 @value3 @value2;
178
+ }
179
+
180
+ margin: @value1 @value2 @value3 @value4;
181
+ }
182
+
183
+ // CSS property: inset-inline (positions): https://caniuse.com/mdn-css_properties_inset-inline
184
+
185
+ .left(@currentDirectionPositionValue, @oppositeDirectionPositionValue: initial) {
186
+ [dir="rtl"] & {
187
+ right: @currentDirectionPositionValue;
188
+ left: @oppositeDirectionPositionValue;
189
+ }
190
+
191
+ left: @currentDirectionPositionValue;
192
+ }
193
+
194
+ .right(@currentDirectionPositionValue, @oppositeDirectionPositionValue: initial) {
195
+ [dir="rtl"] & {
196
+ left: @currentDirectionPositionValue;
197
+ right: @oppositeDirectionPositionValue;
198
+ }
199
+
200
+ right: @currentDirectionPositionValue;
201
+ }
202
+
203
+ // CSS property: border-inline-start https://caniuse.com/mdn-css_properties_border-inline-start
204
+
205
+ .border(@direction, @size, @style: ~'', @color: ~'') {
206
+ & when (@direction = left) {
207
+ [dir="rtl"] & {
208
+ border-right: @size @style @color;
209
+ }
210
+
211
+ html:not([dir="rtl"]) & {
212
+ border-@{direction}: @size @style @color;
213
+ }
214
+ }
215
+ & when (@direction = right) {
216
+ [dir="rtl"] & {
217
+ border-left: @size @style @color;
218
+ }
219
+
220
+ html:not([dir="rtl"]) & {
221
+ border-@{direction}: @size @style @color;
222
+ }
223
+ }
224
+ }
225
+
226
+ .border-width(@direction, @size) {
227
+ & when (@direction = left) {
228
+ [dir="rtl"] & {
229
+ border-right-width: @size;
230
+ }
231
+
232
+ html:not([dir="rtl"]) & {
233
+ border-@{direction}-width: @size;
234
+ }
235
+ }
236
+
237
+ & when (@direction = right) {
238
+ [dir="rtl"] & {
239
+ border-left-width: @size;
240
+ }
241
+
242
+ html:not([dir="rtl"]) & {
243
+ border-@{direction}-width: @size;
244
+ }
245
+ }
246
+ }
247
+
248
+ // CSS property: border-start-start-radius: https://caniuse.com/mdn-css_properties_border-start-start-radius
249
+
250
+ // | top-left | top-right |
251
+ // | bottom-left | bottom-right |
252
+
253
+ .border-radius(@direction, @radius) {
254
+ & when (@direction = left) {
255
+ [dir="rtl"] & {
256
+ border-bottom-right-radius: @radius;
257
+ border-top-right-radius: @radius;
258
+ }
259
+
260
+ html:not([dir="rtl"]) & {
261
+ border-bottom-@{direction}-radius: @radius;
262
+ border-top-@{direction}-radius: @radius;
263
+ }
264
+ }
265
+
266
+ & when (@direction = right) {
267
+ [dir="rtl"] & {
268
+ border-bottom-left-radius: @radius;
269
+ border-top-left-radius: @radius;
270
+ }
271
+
272
+ html:not([dir="rtl"]) & {
273
+ border-bottom-@{direction}-radius: @radius;
274
+ border-top-@{direction}-radius: @radius;
275
+ }
276
+ }
277
+ }
278
+
279
+ .border-top-dir-radius(@direction, @radius) {
280
+ & when (@direction = left) {
281
+ [dir="rtl"] & {
282
+ border-top-right-radius: @radius;
283
+ }
284
+
285
+ html:not([dir="rtl"]) & {
286
+ border-top-@{direction}-radius: @radius;
287
+ }
288
+ }
289
+
290
+ & when (@direction = right) {
291
+ [dir="rtl"] & {
292
+ border-top-left-radius: @radius;
293
+ }
294
+
295
+ html:not([dir="rtl"]) & {
296
+ border-top-@{direction}-radius: @radius;
297
+ }
298
+ }
299
+ }
300
+
301
+ .border-bottom-dir-radius(@direction, @radius) {
302
+ & when (@direction = left) {
303
+ [dir="rtl"] & {
304
+ border-bottom-right-radius: @radius;
305
+ }
306
+
307
+ html:not([dir="rtl"]) & {
308
+ border-bottom-@{direction}-radius: @radius;
309
+ }
310
+ }
311
+
312
+ & when (@direction = right) {
313
+ [dir="rtl"] & {
314
+ border-bottom-left-radius: @radius;
315
+ }
316
+
317
+ html:not([dir="rtl"]) & {
318
+ border-bottom-@{direction}-radius: @radius;
319
+ }
320
+ }
321
+ }
322
+
323
+ // Background position
324
+
325
+ .background-position(@direction, @vertical-direction: ~'') {
326
+ & when (@direction = left) {
327
+ [dir="rtl"] & {
328
+ background-position: right @vertical-direction;
329
+ }
330
+
331
+ background-position: left @vertical-direction;
332
+ }
333
+
334
+ & when (@direction = right) {
335
+ [dir="rtl"] & {
336
+ background-position: left @vertical-direction;
337
+ }
338
+
339
+ background-position: right @vertical-direction;
340
+ }
341
+ }
342
+
343
+ // Horizontal linear gradient
344
+
345
+ .background-linear-gradient(@direction, @color1, @color2) {
346
+ & when (@direction = left) {
347
+ [dir="rtl"] & {
348
+ background: linear-gradient(to right, @color1, @color2);
349
+ }
350
+
351
+ background: linear-gradient(to left, @color1, @color2);
352
+ }
353
+
354
+ & when (@direction = right) {
355
+ [dir="rtl"] & {
356
+ background: linear-gradient(to left, @color1, @color2);
357
+ }
358
+
359
+ background: linear-gradient(to right, @color1, @color2);
360
+ }
361
+ }
362
+
363
+ // Horizontal translations
364
+
365
+ .translateX(@value, @transform2: ~'', @transform3: ~'') {
366
+ [dir="rtl"] & {
367
+ transform: translateX(@value * -1) @transform2 @transform3;
368
+ }
369
+
370
+ transform: translateX(@value) @transform2 @transform3;
371
+ }
372
+
373
+ // Rotations
374
+
375
+ .rotate(@deg) {
376
+ [dir="rtl"] & {
377
+ transform: rotate(@deg * -1);
378
+ }
379
+
380
+ transform: rotate(@deg);
381
+ }