gerillass 2.3.1 → 3.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.
- checksums.yaml +4 -4
- data/README.md +6 -6
- data/SKILL.md +6 -7
- data/gerillass.json +270 -108
- data/scss/internal/_gradient.scss +425 -0
- data/scss/library/_background-dots.scss +7 -6
- data/scss/library/_background-image.scss +6 -30
- data/scss/library/_background-stripes.scss +6 -17
- data/scss/library/_gradient.scss +31 -0
- data/scss/library/_index.scss +1 -2
- data/scss/library/_text-gradient.scss +36 -26
- data/scss/utilities/_gradient-value.scss +24 -0
- data/scss/utilities/_index.scss +1 -0
- metadata +4 -3
- data/scss/library/_linear-gradient.scss +0 -33
- data/scss/library/_radial-gradient.scss +0 -184
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7c5549f5633296720e952c5a6eaae5ff64506892d3ca368a4392a90460bb05e4
|
|
4
|
+
data.tar.gz: e41cbfe9d9f32d6e83d18af5eef518c377aad6ff8d9bd01d9bc770c50a2ea2bd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d251a303526d829aafc1ae9240beb03f3e807f5797efc80bf191e446fee3944beeeccbd9bed036d147465459280da235c95318a708db61a746d45e06b19d9a0
|
|
7
|
+
data.tar.gz: 9a625b0e3388e9c887146af9fb1a410ff9e843cc7ad38220ace82dc40c8e46b59e783474a8b59273927bb525374ec249f5c18d48c9cafbe65b074b067ce69bb2
|
data/README.md
CHANGED
|
@@ -303,21 +303,21 @@ So, feel free to use any tool to support that. My suggestion is Autoprefixer. If
|
|
|
303
303
|
|
|
304
304
|
## Experimenting
|
|
305
305
|
|
|
306
|
-
|
|
306
|
+
The quickest way to try Gerillass is the [playground](https://gerillass.com/playground). It runs in your browser, so there is nothing to install: write Sass on one side and read the CSS it compiles to on the other. Pick a mixin to start from an example, and pick any published Gerillass version to compile against, which makes it easy to see how a call behaves before and after an upgrade.
|
|
307
307
|
|
|
308
|
-
|
|
308
|
+
When you are ready to use it in a project, follow the [installation](#installation) steps for your build tool.
|
|
309
309
|
|
|
310
310
|
## Testing
|
|
311
311
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
You can find two test examples under the `test` folder, take your time, examine the codes, and then write your unit tests. After that, run the following command to see if the tests pass.
|
|
312
|
+
The test suite runs with [Jest](https://jestjs.io/) and [True](https://github.com/oddbird/true), which makes Sass unit tests possible (endless thanks to the [OddBird Team](https://github.com/oddbird)).
|
|
315
313
|
|
|
316
314
|
npm test
|
|
317
315
|
|
|
316
|
+
It checks more than hand-written assertions: every mixin is called at least once, every documented example is compiled and compared with a snapshot, and every input a mixin should refuse must stop the build with the library's own error message. [CONTRIBUTING.md](CONTRIBUTING.md#testing) explains which of these a change needs.
|
|
317
|
+
|
|
318
318
|
## Contribution
|
|
319
319
|
|
|
320
|
-
Please read the [contribution details](CONTRIBUTING.md) and feel free to contribute to the library.
|
|
320
|
+
Please read the [contribution details](CONTRIBUTING.md) and feel free to contribute to the library. If you are working on a mixin, the site's dev server has a lab that renders your working copy of the library as you edit it; [CONTRIBUTING.md](CONTRIBUTING.md#seeing-what-it-renders) shows how to use it.
|
|
321
321
|
|
|
322
322
|
## License
|
|
323
323
|
|
data/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: Use the Gerillass Sass mixin library — loading it, the mixin cata
|
|
|
5
5
|
|
|
6
6
|
# Gerillass
|
|
7
7
|
|
|
8
|
-
A Sass mixin library:
|
|
8
|
+
A Sass mixin library: 55 mixins and 24 functions that emit CSS from
|
|
9
9
|
semantic declarations. It is Sass source only — there is no runtime and no
|
|
10
10
|
utility classes, so styles live in your stylesheet and your markup stays clean.
|
|
11
11
|
|
|
@@ -100,14 +100,13 @@ a dropped declaration rather than an error.
|
|
|
100
100
|
| `except` | `.a { @include except(#ff0000) { margin: 0; } }` |
|
|
101
101
|
| `focus-ring` | `@include focus-ring;` |
|
|
102
102
|
| `font-face` | `.a { @include font-face("Inter", "/fonts/inter"); }` |
|
|
103
|
+
| `gradient` | `.a { @include gradient((red, blue), sideways); }` |
|
|
103
104
|
| `hide` | `.a { @include hide(nonsense); }` |
|
|
104
105
|
| `line-clamp` | `.a { @include line-clamp(0); }` |
|
|
105
|
-
| `linear-gradient` | `.a { @include linear-gradient(sideways, (red, blue)); }` |
|
|
106
106
|
| `loadify` | `@include loadify(nonsense);` |
|
|
107
107
|
| `motion-safe` | `.card { @include motion-safe; }` |
|
|
108
108
|
| `only` | `.a { @include only(#ff0000) { margin: 0; } }` |
|
|
109
109
|
| `position` | `.badge { @include position(absolute, 0, $logical: yes); }` |
|
|
110
|
-
| `radial-gradient` | `.a { @include radial-gradient(42, "center", (red, blue)); }` |
|
|
111
110
|
| `remove` | `.a { @include remove(a, b, c); }` |
|
|
112
111
|
| `reset-css` | `.a { @include reset-css; }` |
|
|
113
112
|
| `resizable` | `.a { @include resizable(huge); }` |
|
|
@@ -118,7 +117,7 @@ a dropped declaration rather than an error.
|
|
|
118
117
|
| `sprite` | `.icon { @include sprite("/img/sprite.txt"); }` |
|
|
119
118
|
| `stretched-link` | `.card a { @include stretched-link(middle); }` |
|
|
120
119
|
| `tablet` | `.a { @include tablet(Surface) { display: none; } }` |
|
|
121
|
-
| `text-gradient` | `.a { @include text-gradient(
|
|
120
|
+
| `text-gradient` | `.a { @include text-gradient("top", (red, blue)); }` |
|
|
122
121
|
| `text-image` | `.a { @include text-image(16 9); }` |
|
|
123
122
|
| `text-selection` | `.a { @include text-selection(bogus) { background: yellow; } }` |
|
|
124
123
|
| `text-shadow` | `.a { @include text-shadow(42); }` |
|
|
@@ -209,16 +208,15 @@ a dropped declaration rather than an error.
|
|
|
209
208
|
| `except($params...)` | Selects every sibling except the ones named. |
|
|
210
209
|
| `focus-ring($width: 2px, $offset: 2px, $color: currentColor)` | Draws a keyboard focus ring with outline on :focus-visible, which survives forced-colors mode where a box-shadow ring disappears. |
|
|
211
210
|
| `font-face($font-family, $file-path, $font-style: normal, $font-weight: 400, $file-formats: eot woff2 woff ttf svg, $font-display: null)` | Emits an @font-face rule for one family across several file formats. Must be called at the root. |
|
|
211
|
+
| `gradient($colors, $type: linear, $direction: null, $shape: null, $position: null, $from: null, $in: null, $repeating: false)` | A linear, radial or conic gradient as background-image, plain or repeating, with an optional colour interpolation space. Replaced linear-gradient and radial-gradient in 3.0.0. |
|
|
212
212
|
| `hide($toggle: "hide")` | Visually hides an element while keeping it available to screen readers, or reverses that. |
|
|
213
213
|
| `line-clamp($lines: 3)` | Truncates text after a number of lines, where ellipsis truncates one. It emits five declarations rather than one because -webkit-line-clamp does nothing on its own: without display: -webkit-box or without -webkit-box-orient: vertical the text is not clamped at all and nothing warns you, and without overflow: hidden the clamped text spills out below the box. The unprefixed line-clamp is emitted too, for when it becomes Baseline. |
|
|
214
|
-
| `linear-gradient($direction, $colors)` | Linear gradient background from a direction name or an angle. |
|
|
215
214
|
| `loadify($params...)` | Fades elements in on page load. Call once at the root to set up, then on each element. Under prefers-reduced-motion: reduce the end state is applied directly and no animation runs. Switching the animation off alone would not do, because the element starts invisible and the animation is what reveals it, so the content would stay hidden for good. |
|
|
216
215
|
| `motion-safe` | Wraps its content in @media (prefers-reduced-motion: no-preference), so motion is opt-in: a user who asked their system for less motion gets none of it. |
|
|
217
216
|
| `only($params...)` | Selects only the siblings named. |
|
|
218
217
|
| `placeholder-shown` | Styles an input while its placeholder is visible. |
|
|
219
218
|
| `placeholder` | Styles the placeholder text of an input across vendor prefixes. |
|
|
220
219
|
| `position($position: absolute, $offsets: 0, $logical: false)` | Sets position and offsets in one call, using shorthand order. |
|
|
221
|
-
| `radial-gradient($shape, $position, $colors)` | Radial gradient background from a shape and a position. |
|
|
222
220
|
| `remove($params...)` | Hides an element outright, or within a media query: from a breakpoint up with min, up to it with max, or between two breakpoints. One breakpoint on its own hides the element at exactly that width, a single pixel, and prints a warning: pass only for that. |
|
|
223
221
|
| `reset-css` | Meyer reset. Must be called at the root of the stylesheet. |
|
|
224
222
|
| `reset-figure` | Removes default figure margins and makes the image inside responsive. |
|
|
@@ -231,7 +229,7 @@ a dropped declaration rather than an error.
|
|
|
231
229
|
| `sprite($params...)` | Sets up an element as a sprite tile: an image, a background position, or both. |
|
|
232
230
|
| `stretched-link($value: "before")` | Expands a link to cover its positioned parent, so the whole card is clickable. |
|
|
233
231
|
| `tablet($device, $orientation: null)` | Media query targeting a known tablet by device dimensions. |
|
|
234
|
-
| `text-gradient($direction, $
|
|
232
|
+
| `text-gradient($colors, $type: linear, $direction: null, $shape: null, $position: null, $from: null, $in: null, $repeating: false)` | Fills the text with a gradient through background-clip: text. It takes the gradient mixin's arguments, colours first: a linear, radial or conic gradient, plain or repeating, with an optional colour space. |
|
|
235
233
|
| `text-image($image: null)` | Fills the text with an image via background-clip. |
|
|
236
234
|
| `text-selection($value: null)` | Styles the ::selection pseudo-element. |
|
|
237
235
|
| `text-shadow($params...)` | Layered text shadows built from a direction, a colour and an offset. |
|
|
@@ -254,6 +252,7 @@ and camelCase is what tells them apart from the kebab-case mixins above.
|
|
|
254
252
|
| `fluid($min, $max, $min-viewport: 320px, $max-viewport: 1280px)` | A clamp() value that grows with the viewport between two widths, then stops. The preferred value keeps a rem term rather than being pure vw, because a vw-only value ignores browser text zoom and fails WCAG 1.4.4. It is a function rather than a mixin because the value is the hard part and belongs to any property, not only font-size. |
|
|
255
253
|
| `fontSizer($size, $time)` | Multiplies a size by a factor. Handy for a modular scale. |
|
|
256
254
|
| `fontSource($font-family, $file-path, $file-formats)` | Builds one src entry for an @font-face rule. |
|
|
255
|
+
| `gradientValue($colors, $type: linear, $direction: null, $shape: null, $position: null, $from: null, $in: null, $repeating: false)` | The gradient mixin's gradient as a value, for layering it with an image in one background-image, or using it as a mask-image or border-image. It takes the same arguments and refuses the same input, but cannot write the fallback the mixin writes before a gradient with $in. |
|
|
257
256
|
| `isColor($value)` | Returns the value if every item in it is a colour, and errors otherwise. |
|
|
258
257
|
| `isGutter($value)` | True for anything that can sit where a CSS length is expected: a number, a calculation, or a CSS function such as var(). |
|
|
259
258
|
| `isNumber($value)` | Returns the value if it is a number. |
|
data/gerillass.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gerillass",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Gerillass is an open-source toolkit that contains a set of Sass mixins to help designers and developers to create better, faster and consistent user interfaces.",
|
|
5
5
|
"homepage": "https://gerillass.com",
|
|
6
6
|
"documentation": "https://docs.gerillass.com",
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
"name": "$filter-color",
|
|
292
292
|
"default": "null",
|
|
293
293
|
"accepts": [
|
|
294
|
-
"one colour, or several colour stops for a gradient, in the forms
|
|
294
|
+
"one colour, or several colour stops for a gradient, in the forms the gradient mixin takes",
|
|
295
295
|
"with $image-url null, an image as the overlay layer too: a gradient, url(), image-set() or var()",
|
|
296
296
|
"a word that is not a colour, a quoted colour, a length and a CSS-wide keyword are refused"
|
|
297
297
|
]
|
|
@@ -300,8 +300,10 @@
|
|
|
300
300
|
"name": "$filter-direction",
|
|
301
301
|
"default": "null",
|
|
302
302
|
"accepts": [
|
|
303
|
-
"
|
|
304
|
-
"
|
|
303
|
+
"a direction name such as top or bottom-left",
|
|
304
|
+
"an angle in deg, grad, rad or turn, or 0",
|
|
305
|
+
"\"to top\" or \"to left top\" as a string",
|
|
306
|
+
"var() or calc()"
|
|
305
307
|
]
|
|
306
308
|
}
|
|
307
309
|
],
|
|
@@ -1043,6 +1045,117 @@
|
|
|
1043
1045
|
"@include font-face(\"Inter\", \"/fonts/inter\", $font-weight: 100 200 300, $file-formats: woff2);"
|
|
1044
1046
|
]
|
|
1045
1047
|
},
|
|
1048
|
+
{
|
|
1049
|
+
"name": "gradient",
|
|
1050
|
+
"kind": "mixin",
|
|
1051
|
+
"arguments": [
|
|
1052
|
+
{
|
|
1053
|
+
"name": "$colors",
|
|
1054
|
+
"required": true,
|
|
1055
|
+
"accepts": [
|
|
1056
|
+
"one or more colour stops: a colour, or a colour with one or two positions, such as (red 0 10%) (blue 10% 100%)",
|
|
1057
|
+
"a position on its own between two colours, as a hint",
|
|
1058
|
+
"for a conic gradient the positions are angles or percentages, not lengths",
|
|
1059
|
+
"var() for a stop or the whole list",
|
|
1060
|
+
"a single colour warns, because browsers before Chrome 135, Firefox 136 and Safari 18.4 drop that gradient"
|
|
1061
|
+
]
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
"name": "$type",
|
|
1065
|
+
"default": "linear",
|
|
1066
|
+
"accepts": [
|
|
1067
|
+
"linear, the default",
|
|
1068
|
+
"radial",
|
|
1069
|
+
"conic"
|
|
1070
|
+
]
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
"name": "$direction",
|
|
1074
|
+
"default": "null",
|
|
1075
|
+
"accepts": [
|
|
1076
|
+
"linear only",
|
|
1077
|
+
"a direction name such as top or bottom-left",
|
|
1078
|
+
"an angle in deg, grad, rad or turn, or 0",
|
|
1079
|
+
"\"to top\" or \"to left top\" as a string",
|
|
1080
|
+
"var() or calc()"
|
|
1081
|
+
]
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
"name": "$shape",
|
|
1085
|
+
"default": "null",
|
|
1086
|
+
"accepts": [
|
|
1087
|
+
"radial only",
|
|
1088
|
+
"circle or ellipse, with an optional size as a string, such as \"circle 10px\""
|
|
1089
|
+
]
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
"name": "$position",
|
|
1093
|
+
"default": "null",
|
|
1094
|
+
"accepts": [
|
|
1095
|
+
"radial or conic",
|
|
1096
|
+
"a position name such as center or top-left",
|
|
1097
|
+
"at followed by a position, as a string, such as \"at 30% 40%\"; a radial gradient may put a size before it"
|
|
1098
|
+
]
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
"name": "$from",
|
|
1102
|
+
"default": "null",
|
|
1103
|
+
"accepts": [
|
|
1104
|
+
"conic only",
|
|
1105
|
+
"an angle in deg, grad, rad or turn, 0, or var()"
|
|
1106
|
+
]
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
"name": "$in",
|
|
1110
|
+
"default": "null",
|
|
1111
|
+
"accepts": [
|
|
1112
|
+
"a colour space: srgb, srgb-linear, display-p3, display-p3-linear, a98-rgb, prophoto-rgb, rec2020, lab, oklab, xyz, xyz-d50 or xyz-d65",
|
|
1113
|
+
"a polar space, hsl, hwb, lch or oklch, with an optional hue method as a string, such as \"oklch longer hue\"",
|
|
1114
|
+
"var()",
|
|
1115
|
+
"the gradient is written once without the space first, for a browser that does not know it"
|
|
1116
|
+
]
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
"name": "$repeating",
|
|
1120
|
+
"default": "false",
|
|
1121
|
+
"accepts": [
|
|
1122
|
+
"false, the default",
|
|
1123
|
+
"true, for a repeating gradient"
|
|
1124
|
+
]
|
|
1125
|
+
}
|
|
1126
|
+
],
|
|
1127
|
+
"file": "scss/library/_gradient.scss",
|
|
1128
|
+
"signature": "gradient($colors, $type: linear, $direction: null, $shape: null, $position: null, $from: null, $in: null, $repeating: false)",
|
|
1129
|
+
"summary": "A linear, radial or conic gradient as background-image, plain or repeating, with an optional colour interpolation space. Replaced linear-gradient and radial-gradient in 3.0.0.",
|
|
1130
|
+
"examples": [
|
|
1131
|
+
".a { @include gradient((red, blue)); }",
|
|
1132
|
+
".a { @include gradient((red, blue), $direction: \"top-right\"); }",
|
|
1133
|
+
".a { @include gradient((red, blue), radial, $shape: circle, $position: \"top-left\"); }",
|
|
1134
|
+
".a { @include gradient((teal 0 40%, purple 40% 75%, coral 75% 100%), conic); }",
|
|
1135
|
+
".a { @include gradient((black 0 25%, white 0 50%), conic, $repeating: true); }",
|
|
1136
|
+
".a { @include gradient((blue, yellow), $direction: right, $in: oklab); }"
|
|
1137
|
+
],
|
|
1138
|
+
"rejects": [
|
|
1139
|
+
".a { @include gradient((red, blue), sideways); }",
|
|
1140
|
+
".a { @include gradient((red, blue), $direction: 10px); }",
|
|
1141
|
+
".a { @include gradient((red, blue), $direction: \"to center\"); }",
|
|
1142
|
+
".a { @include gradient((red, blue), radial, $direction: top); }",
|
|
1143
|
+
".a { @include gradient((red, blue), $shape: circle); }",
|
|
1144
|
+
".a { @include gradient((red, blue), $position: center); }",
|
|
1145
|
+
".a { @include gradient((red, blue), $from: 45deg); }",
|
|
1146
|
+
".a { @include gradient((red, blue), conic, $from: 10px); }",
|
|
1147
|
+
".a { @include gradient((red, blue), conic, $position: \"closest-side at center\"); }",
|
|
1148
|
+
".a { @include gradient((red 10px, blue), conic); }",
|
|
1149
|
+
".a { @include gradient((red, blue), radial, $shape: \"circle 10%\"); }",
|
|
1150
|
+
".a { @include gradient((huge, blue)); }",
|
|
1151
|
+
".a { @include gradient((red, blue), $in: rgb); }",
|
|
1152
|
+
".a { @include gradient((red, blue), $in: \"oklab longer hue\"); }",
|
|
1153
|
+
".a { @include gradient((red, blue), $repeating: yes); }"
|
|
1154
|
+
],
|
|
1155
|
+
"warns": [
|
|
1156
|
+
".a { @include gradient(red); }"
|
|
1157
|
+
]
|
|
1158
|
+
},
|
|
1046
1159
|
{
|
|
1047
1160
|
"name": "hide",
|
|
1048
1161
|
"kind": "mixin",
|
|
@@ -1099,48 +1212,6 @@
|
|
|
1099
1212
|
".a { @include line-clamp(url(a.png)); }"
|
|
1100
1213
|
]
|
|
1101
1214
|
},
|
|
1102
|
-
{
|
|
1103
|
-
"name": "linear-gradient",
|
|
1104
|
-
"kind": "mixin",
|
|
1105
|
-
"arguments": [
|
|
1106
|
-
{
|
|
1107
|
-
"name": "$direction",
|
|
1108
|
-
"required": true,
|
|
1109
|
-
"accepts": [
|
|
1110
|
-
"a direction name such as top or bottom-left",
|
|
1111
|
-
"an angle such as 45deg"
|
|
1112
|
-
]
|
|
1113
|
-
},
|
|
1114
|
-
{
|
|
1115
|
-
"name": "$colors",
|
|
1116
|
-
"required": true,
|
|
1117
|
-
"accepts": [
|
|
1118
|
-
"one or more colour stops: a colour, or a colour with one or two positions, such as (red 0 10%) (blue 10% 100%)",
|
|
1119
|
-
"a position on its own between two colours, as a hint, such as (red, 30%, blue)",
|
|
1120
|
-
"var() for a stop or the whole list",
|
|
1121
|
-
"a word that is not a colour, a position first or last, two positions in a row, three positions in a stop and null are refused, because the gradient would be dropped"
|
|
1122
|
-
]
|
|
1123
|
-
}
|
|
1124
|
-
],
|
|
1125
|
-
"file": "scss/library/_linear-gradient.scss",
|
|
1126
|
-
"signature": "linear-gradient($direction, $colors)",
|
|
1127
|
-
"summary": "Linear gradient background from a direction name or an angle.",
|
|
1128
|
-
"examples": [
|
|
1129
|
-
".a { @include linear-gradient(\"top\", (red, blue)); }",
|
|
1130
|
-
".a { @include linear-gradient(45deg, (red, blue)); }"
|
|
1131
|
-
],
|
|
1132
|
-
"rejects": [
|
|
1133
|
-
".a { @include linear-gradient(sideways, (red, blue)); }",
|
|
1134
|
-
".a { @include linear-gradient(true, (red, blue)); }",
|
|
1135
|
-
".a { @include linear-gradient(\"top\", (huge, blue)); }",
|
|
1136
|
-
".a { @include linear-gradient(\"top\", (inherit, blue)); }",
|
|
1137
|
-
".a { @include linear-gradient(\"top\", (red, 10%)); }",
|
|
1138
|
-
".a { @include linear-gradient(\"top\", (10%, red, blue)); }",
|
|
1139
|
-
".a { @include linear-gradient(\"top\", (red, 30%, 40%, blue)); }",
|
|
1140
|
-
".a { @include linear-gradient(\"top\", (red 10% 20% 30%, blue)); }",
|
|
1141
|
-
".a { @include linear-gradient(\"top\", null); }"
|
|
1142
|
-
]
|
|
1143
|
-
},
|
|
1144
1215
|
{
|
|
1145
1216
|
"name": "loadify",
|
|
1146
1217
|
"kind": "mixin",
|
|
@@ -1307,56 +1378,6 @@
|
|
|
1307
1378
|
".a { @include position(absolute, url(a.png)); }"
|
|
1308
1379
|
]
|
|
1309
1380
|
},
|
|
1310
|
-
{
|
|
1311
|
-
"name": "radial-gradient",
|
|
1312
|
-
"kind": "mixin",
|
|
1313
|
-
"arguments": [
|
|
1314
|
-
{
|
|
1315
|
-
"name": "$shape",
|
|
1316
|
-
"required": true,
|
|
1317
|
-
"accepts": [
|
|
1318
|
-
"circle or ellipse",
|
|
1319
|
-
"with a size as a string: an extent keyword such as \"circle closest-side\", one length for a circle, or two lengths or percentages for an ellipse",
|
|
1320
|
-
"var() or calc()"
|
|
1321
|
-
]
|
|
1322
|
-
},
|
|
1323
|
-
{
|
|
1324
|
-
"name": "$position",
|
|
1325
|
-
"required": true,
|
|
1326
|
-
"accepts": [
|
|
1327
|
-
"a position name such as center or top-left",
|
|
1328
|
-
"an extent keyword such as closest-side",
|
|
1329
|
-
"at followed by a position, as a string, such as \"at 30% 40%\" or \"at left 10px top 20px\", optionally after a size",
|
|
1330
|
-
"a word outside these, such as inherit, is refused, because the whole gradient would be dropped"
|
|
1331
|
-
]
|
|
1332
|
-
},
|
|
1333
|
-
{
|
|
1334
|
-
"name": "$colors",
|
|
1335
|
-
"required": true,
|
|
1336
|
-
"accepts": [
|
|
1337
|
-
"one or more colour stops, in the same forms as linear-gradient: a colour with up to two positions, a position between two colours, or var()",
|
|
1338
|
-
"a stop the browser drops is refused, because the whole gradient would be dropped"
|
|
1339
|
-
]
|
|
1340
|
-
}
|
|
1341
|
-
],
|
|
1342
|
-
"file": "scss/library/_radial-gradient.scss",
|
|
1343
|
-
"signature": "radial-gradient($shape, $position, $colors)",
|
|
1344
|
-
"summary": "Radial gradient background from a shape and a position.",
|
|
1345
|
-
"examples": [
|
|
1346
|
-
".a { @include radial-gradient(circle, \"center\", (red, blue)); }"
|
|
1347
|
-
],
|
|
1348
|
-
"rejects": [
|
|
1349
|
-
".a { @include radial-gradient(42, \"center\", (red, blue)); }",
|
|
1350
|
-
".a { @include radial-gradient(circle, 42, (red, blue)); }",
|
|
1351
|
-
".a { @include radial-gradient(huge, \"center\", (red, blue)); }",
|
|
1352
|
-
".a { @include radial-gradient(\"circle 10%\", \"center\", (red, blue)); }",
|
|
1353
|
-
".a { @include radial-gradient(circle, huge, (red, blue)); }",
|
|
1354
|
-
".a { @include radial-gradient(circle, \"at huge\", (red, blue)); }",
|
|
1355
|
-
".a { @include radial-gradient(circle, inherit, (red, blue)); }",
|
|
1356
|
-
".a { @include radial-gradient(circle, \"center\", (huge, blue)); }",
|
|
1357
|
-
".a { @include radial-gradient(circle, \"center\", (red, blue, 90%)); }"
|
|
1358
|
-
]
|
|
1359
|
-
},
|
|
1360
1381
|
{
|
|
1361
1382
|
"name": "remove",
|
|
1362
1383
|
"kind": "mixin",
|
|
@@ -1686,32 +1707,89 @@
|
|
|
1686
1707
|
"kind": "mixin",
|
|
1687
1708
|
"arguments": [
|
|
1688
1709
|
{
|
|
1689
|
-
"name": "$
|
|
1710
|
+
"name": "$colors",
|
|
1690
1711
|
"required": true,
|
|
1691
1712
|
"accepts": [
|
|
1713
|
+
"one or more colour stops, in the forms the gradient mixin takes",
|
|
1714
|
+
"a stop the browser drops is refused, because the gradient and the transparent text would go with it",
|
|
1715
|
+
"a single colour warns"
|
|
1716
|
+
]
|
|
1717
|
+
},
|
|
1718
|
+
{
|
|
1719
|
+
"name": "$type",
|
|
1720
|
+
"default": "linear",
|
|
1721
|
+
"accepts": [
|
|
1722
|
+
"linear, the default",
|
|
1723
|
+
"radial",
|
|
1724
|
+
"conic"
|
|
1725
|
+
]
|
|
1726
|
+
},
|
|
1727
|
+
{
|
|
1728
|
+
"name": "$direction",
|
|
1729
|
+
"default": "null",
|
|
1730
|
+
"accepts": [
|
|
1731
|
+
"linear only",
|
|
1692
1732
|
"a direction name such as top or bottom-left",
|
|
1693
|
-
"an angle
|
|
1733
|
+
"an angle in deg, grad, rad or turn, or 0",
|
|
1734
|
+
"\"to top\" or \"to left top\" as a string",
|
|
1735
|
+
"var() or calc()"
|
|
1694
1736
|
]
|
|
1695
1737
|
},
|
|
1696
1738
|
{
|
|
1697
|
-
"name": "$
|
|
1698
|
-
"
|
|
1739
|
+
"name": "$shape",
|
|
1740
|
+
"default": "null",
|
|
1699
1741
|
"accepts": [
|
|
1700
|
-
"
|
|
1701
|
-
|
|
1742
|
+
"radial only, circle or ellipse with an optional size"
|
|
1743
|
+
]
|
|
1744
|
+
},
|
|
1745
|
+
{
|
|
1746
|
+
"name": "$position",
|
|
1747
|
+
"default": "null",
|
|
1748
|
+
"accepts": [
|
|
1749
|
+
"radial or conic, a position name or at followed by a position"
|
|
1750
|
+
]
|
|
1751
|
+
},
|
|
1752
|
+
{
|
|
1753
|
+
"name": "$from",
|
|
1754
|
+
"default": "null",
|
|
1755
|
+
"accepts": [
|
|
1756
|
+
"conic only, an angle"
|
|
1757
|
+
]
|
|
1758
|
+
},
|
|
1759
|
+
{
|
|
1760
|
+
"name": "$in",
|
|
1761
|
+
"default": "null",
|
|
1762
|
+
"accepts": [
|
|
1763
|
+
"a colour space such as oklab, or a polar one with a hue method",
|
|
1764
|
+
"the gradient is written once without the space first, for a browser that does not know it"
|
|
1765
|
+
]
|
|
1766
|
+
},
|
|
1767
|
+
{
|
|
1768
|
+
"name": "$repeating",
|
|
1769
|
+
"default": "false",
|
|
1770
|
+
"accepts": [
|
|
1771
|
+
"false, the default",
|
|
1772
|
+
"true"
|
|
1702
1773
|
]
|
|
1703
1774
|
}
|
|
1704
1775
|
],
|
|
1705
1776
|
"file": "scss/library/_text-gradient.scss",
|
|
1706
|
-
"signature": "text-gradient($direction, $
|
|
1707
|
-
"summary": "
|
|
1777
|
+
"signature": "text-gradient($colors, $type: linear, $direction: null, $shape: null, $position: null, $from: null, $in: null, $repeating: false)",
|
|
1778
|
+
"summary": "Fills the text with a gradient through background-clip: text. It takes the gradient mixin's arguments, colours first: a linear, radial or conic gradient, plain or repeating, with an optional colour space.",
|
|
1708
1779
|
"examples": [
|
|
1709
|
-
".a { @include text-gradient(
|
|
1780
|
+
".a { @include text-gradient((red, blue), $direction: top); }",
|
|
1781
|
+
".a { @include text-gradient(blue yellow, $direction: right, $in: oklab); }",
|
|
1782
|
+
".a { @include text-gradient(red yellow lime cyan blue magenta red, conic); }"
|
|
1710
1783
|
],
|
|
1711
1784
|
"rejects": [
|
|
1712
|
-
".a { @include text-gradient(
|
|
1713
|
-
".a { @include text-gradient(
|
|
1714
|
-
".a { @include text-gradient(
|
|
1785
|
+
".a { @include text-gradient(\"top\", (red, blue)); }",
|
|
1786
|
+
".a { @include text-gradient(red blue, $direction: sideways); }",
|
|
1787
|
+
".a { @include text-gradient((huge, blue)); }",
|
|
1788
|
+
".a { @include text-gradient((\"red\", blue)); }",
|
|
1789
|
+
".a { @include text-gradient(red blue, $from: 45deg); }"
|
|
1790
|
+
],
|
|
1791
|
+
"warns": [
|
|
1792
|
+
".a { @include text-gradient(red); }"
|
|
1715
1793
|
]
|
|
1716
1794
|
},
|
|
1717
1795
|
{
|
|
@@ -2187,6 +2265,90 @@
|
|
|
2187
2265
|
],
|
|
2188
2266
|
"rejects": []
|
|
2189
2267
|
},
|
|
2268
|
+
{
|
|
2269
|
+
"name": "gradientValue",
|
|
2270
|
+
"kind": "function",
|
|
2271
|
+
"arguments": [
|
|
2272
|
+
{
|
|
2273
|
+
"name": "$colors",
|
|
2274
|
+
"required": true,
|
|
2275
|
+
"accepts": [
|
|
2276
|
+
"the colour stops, in the forms the gradient mixin takes",
|
|
2277
|
+
"a single colour warns, because browsers before Chrome 135, Firefox 136 and Safari 18.4 drop that gradient"
|
|
2278
|
+
]
|
|
2279
|
+
},
|
|
2280
|
+
{
|
|
2281
|
+
"name": "$type",
|
|
2282
|
+
"default": "linear",
|
|
2283
|
+
"accepts": [
|
|
2284
|
+
"linear, the default",
|
|
2285
|
+
"radial",
|
|
2286
|
+
"conic"
|
|
2287
|
+
]
|
|
2288
|
+
},
|
|
2289
|
+
{
|
|
2290
|
+
"name": "$direction",
|
|
2291
|
+
"default": "null",
|
|
2292
|
+
"accepts": [
|
|
2293
|
+
"linear only, in the forms the gradient mixin takes"
|
|
2294
|
+
]
|
|
2295
|
+
},
|
|
2296
|
+
{
|
|
2297
|
+
"name": "$shape",
|
|
2298
|
+
"default": "null",
|
|
2299
|
+
"accepts": [
|
|
2300
|
+
"radial only, circle or ellipse with an optional size"
|
|
2301
|
+
]
|
|
2302
|
+
},
|
|
2303
|
+
{
|
|
2304
|
+
"name": "$position",
|
|
2305
|
+
"default": "null",
|
|
2306
|
+
"accepts": [
|
|
2307
|
+
"radial or conic, a position name or at followed by a position"
|
|
2308
|
+
]
|
|
2309
|
+
},
|
|
2310
|
+
{
|
|
2311
|
+
"name": "$from",
|
|
2312
|
+
"default": "null",
|
|
2313
|
+
"accepts": [
|
|
2314
|
+
"conic only, an angle"
|
|
2315
|
+
]
|
|
2316
|
+
},
|
|
2317
|
+
{
|
|
2318
|
+
"name": "$in",
|
|
2319
|
+
"default": "null",
|
|
2320
|
+
"accepts": [
|
|
2321
|
+
"a colour space, with a hue method for a polar one",
|
|
2322
|
+
"var()"
|
|
2323
|
+
]
|
|
2324
|
+
},
|
|
2325
|
+
{
|
|
2326
|
+
"name": "$repeating",
|
|
2327
|
+
"default": "false",
|
|
2328
|
+
"accepts": [
|
|
2329
|
+
"false, the default",
|
|
2330
|
+
"true"
|
|
2331
|
+
]
|
|
2332
|
+
}
|
|
2333
|
+
],
|
|
2334
|
+
"file": "scss/utilities/_gradient-value.scss",
|
|
2335
|
+
"signature": "gradientValue($colors, $type: linear, $direction: null, $shape: null, $position: null, $from: null, $in: null, $repeating: false)",
|
|
2336
|
+
"summary": "The gradient mixin's gradient as a value, for layering it with an image in one background-image, or using it as a mask-image or border-image. It takes the same arguments and refuses the same input, but cannot write the fallback the mixin writes before a gradient with $in.",
|
|
2337
|
+
"examples": [
|
|
2338
|
+
".a { background-image: gradientValue((rgba(0, 0, 0, 0.75), transparent), $direction: top), url(\"/img/hero.jpg\"); }",
|
|
2339
|
+
".a { mask-image: gradientValue((#000 60%, transparent)); }",
|
|
2340
|
+
".a { border: 4px solid; border-image: gradientValue((red, blue), $direction: right) 1; }"
|
|
2341
|
+
],
|
|
2342
|
+
"rejects": [
|
|
2343
|
+
".a { background-image: gradientValue((red, blue), $direction: sideways); }",
|
|
2344
|
+
".a { background-image: gradientValue((red, blue), $shape: circle); }",
|
|
2345
|
+
".a { background-image: gradientValue((red 10px, blue), conic); }",
|
|
2346
|
+
".a { background-image: gradientValue((red, blue), $in: rgb); }"
|
|
2347
|
+
],
|
|
2348
|
+
"warns": [
|
|
2349
|
+
".a { background-image: gradientValue(red); }"
|
|
2350
|
+
]
|
|
2351
|
+
},
|
|
2190
2352
|
{
|
|
2191
2353
|
"name": "isColor",
|
|
2192
2354
|
"kind": "function",
|