Deprecate browser support

Bump integration tools to 2.1.0
This commit is contained in:
Angelos Chalaris
2020-04-29 13:47:57 +03:00
parent 6d85008a04
commit d2c10f3e65
56 changed files with 158 additions and 545 deletions

View File

@ -50,4 +50,3 @@ Replace `<my-snippet-name>` with the name of the snippet you are adding.
- Always use soft tabs (2 spaces), never hard tabs. - Always use soft tabs (2 spaces), never hard tabs.
- Leave a single space after a comma (`,`) character (both in the description and code). - Leave a single space after a comma (`,`) character (both in the description and code).
- Define multiple variables on the same line, if possible. Use meaningful names (e.g. `letter` instead of `lt`) and follow existing conventions as seen in other snippets. Do not use trailing or leading underscores in variable names. - Define multiple variables on the same line, if possible. Use meaningful names (e.g. `letter` instead of `lt`) and follow existing conventions as seen in other snippets. Do not use trailing or leading underscores in variable names.
- Snippet browser support should be specified as a list of links to https://www.caniuse.com/ features. Use the `#` next to the feature that you want in the website to get a link to it.

74
package-lock.json generated
View File

@ -5,13 +5,12 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@30-seconds/integration-tools": { "@30-seconds/integration-tools": {
"version": "2.0.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/@30-seconds/integration-tools/-/integration-tools-2.0.0.tgz", "resolved": "https://registry.npmjs.org/@30-seconds/integration-tools/-/integration-tools-2.1.0.tgz",
"integrity": "sha512-H8zGBo5ZFwa9S0juRFK8KWlnlA4GZijVrRWdiQeQ/UofernNnUg8Yck1YSNwoWl/vCIKEGlmCqB+sVQz6Jx5yA==", "integrity": "sha512-lqVYh6qjetvtUTviciVlls+aJCSForj3THn+A/9nxYXwEQFKqlboqYs1k8qwMh9eHH2CDfRdLYGruo9E0WPXmg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/core": "^7.7.4", "@babel/core": "^7.7.4",
"caniuse-db": "^1.0.30001012",
"front-matter": "^3.0.2", "front-matter": "^3.0.2",
"fs-extra": "^8.1.0", "fs-extra": "^8.1.0",
"inquirer": "^7.0.0", "inquirer": "^7.0.0",
@ -404,12 +403,6 @@
"map-obj": "^1.0.0" "map-obj": "^1.0.0"
} }
}, },
"caniuse-db": {
"version": "1.0.30001043",
"resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30001043.tgz",
"integrity": "sha512-Dipx6NfbkUVEil8AUo/vt8oa9AF2JnR3mNpKV5YaB0a/v4nvDO8pzCuVdPJqr15FmSY6dBobciTDNLzbdVpVTA==",
"dev": true
},
"caseless": { "caseless": {
"version": "0.12.0", "version": "0.12.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
@ -875,9 +868,9 @@
} }
}, },
"graceful-fs": { "graceful-fs": {
"version": "4.2.3", "version": "4.2.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
"integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
"dev": true "dev": true
}, },
"har-schema": { "har-schema": {
@ -1079,12 +1072,6 @@
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true "dev": true
}, },
"is-promise": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
"integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=",
"dev": true
},
"is-typedarray": { "is-typedarray": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
@ -1276,18 +1263,18 @@
} }
}, },
"mime-db": { "mime-db": {
"version": "1.43.0", "version": "1.44.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
"integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==",
"dev": true "dev": true
}, },
"mime-types": { "mime-types": {
"version": "2.1.26", "version": "2.1.27",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
"integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
"dev": true, "dev": true,
"requires": { "requires": {
"mime-db": "1.43.0" "mime-db": "1.44.0"
} }
}, },
"mimic-fn": { "mimic-fn": {
@ -1333,9 +1320,9 @@
"dev": true "dev": true
}, },
"nan": { "nan": {
"version": "2.14.0", "version": "2.14.1",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz",
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==",
"dev": true "dev": true
}, },
"node-gyp": { "node-gyp": {
@ -1367,9 +1354,9 @@
} }
}, },
"node-sass": { "node-sass": {
"version": "4.13.1", "version": "4.14.0",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.1.tgz", "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.0.tgz",
"integrity": "sha512-TTWFx+ZhyDx1Biiez2nB0L3YrCZ/8oHagaDalbuBSlqXgUPsdkUSzJsVxeDO9LtPB49+Fh3WQl3slABo6AotNw==", "integrity": "sha512-AxqU+DFpk0lEz95sI6jO0hU0Rwyw7BXVEv6o9OItoXLyeygPeaSpiV4rwQb10JiTghHaa0gZeD21sz+OsQluaw==",
"dev": true, "dev": true,
"requires": { "requires": {
"async-foreach": "^0.1.3", "async-foreach": "^0.1.3",
@ -1727,9 +1714,9 @@
"dev": true "dev": true
}, },
"resolve": { "resolve": {
"version": "1.16.1", "version": "1.17.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.16.1.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
"integrity": "sha512-rmAglCSqWWMrrBv/XM6sW0NuRFiKViw/W4d9EbC4pt+49H8JwHy+mcGmALTEg504AUDcLTvb1T2q3E9AnmY+ig==", "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
"dev": true, "dev": true,
"requires": { "requires": {
"path-parse": "^1.0.6" "path-parse": "^1.0.6"
@ -1755,13 +1742,10 @@
} }
}, },
"run-async": { "run-async": {
"version": "2.4.0", "version": "2.4.1",
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz",
"integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==",
"dev": true, "dev": true
"requires": {
"is-promise": "^2.1.0"
}
}, },
"rxjs": { "rxjs": {
"version": "6.5.5", "version": "6.5.5",
@ -1852,9 +1836,9 @@
} }
}, },
"spdx-exceptions": { "spdx-exceptions": {
"version": "2.2.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
"integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==",
"dev": true "dev": true
}, },
"spdx-expression-parse": { "spdx-expression-parse": {

View File

@ -8,12 +8,7 @@
}, },
"author": "atomiks", "author": "atomiks",
"license": "MIT", "license": "MIT",
"prettier": {
"printWidth": 100,
"semi": false,
"singleQuote": true
},
"devDependencies": { "devDependencies": {
"@30-seconds/integration-tools": "^2.0.0" "@30-seconds/integration-tools": "^2.1.0"
} }
} }

View File

@ -28,7 +28,3 @@ console.log(
- Explain briefly how the snippet works. - Explain briefly how the snippet works.
- Use bullet points for your snippet's explanation. - Use bullet points for your snippet's explanation.
- Try to explain everything briefly but clearly. - Try to explain everything briefly but clearly.
#### Browser support
- https://www.caniuse.com/#feat=border-radius

File diff suppressed because it is too large Load Diff

View File

@ -43,5 +43,3 @@ Creates a text container with a triangle at the top.
- The color of the `:after` triangle should be the same as the container's background color. - The color of the `:after` triangle should be the same as the container's background color.
- The border width of the `:before` triangle should be `1px` wider than the `:after` triangle, in order to act as the border. - The border width of the `:before` triangle should be `1px` wider than the `:after` triangle, in order to act as the border.
- The `:after` triangle should be `1px` to the right of the `:before` triangle to allow for its left border to be shown. - The `:after` triangle should be `1px` to the right of the `:before` triangle to allow for its left border to be shown.
#### Browser support

View File

@ -55,7 +55,3 @@ Note: `1rem` is usually `16px`.
- `animation` is a shorthand property for the various animation properties: `animation-name`, `animation-duration`, `animation-iteration-count`, `animation-direction` are used. - `animation` is a shorthand property for the various animation properties: `animation-name`, `animation-duration`, `animation-iteration-count`, `animation-direction` are used.
- `nth-child(n)` targets the element which is the nth child of its parent. - `nth-child(n)` targets the element which is the nth child of its parent.
- `animation-delay` is used on the second and third `div` respectively, so that each element does not start the animation at the same time. - `animation-delay` is used on the second and third `div` respectively, so that each element does not start the animation at the same time.
#### Browser support
- https://caniuse.com/#feat=css-animation

View File

@ -39,7 +39,5 @@ div {
#### Explanation #### Explanation
1. `box-sizing: border-box` makes the addition of `padding` or `border`s not affect an element's `width` or `height`. - `box-sizing: border-box` makes the addition of `padding` or `border`s not affect an element's `width` or `height`.
2. `box-sizing: inherit` makes an element respect its parent's `box-sizing` rule. - `box-sizing: inherit` makes an element respect its parent's `box-sizing` rule.
#### Browser support

View File

@ -50,5 +50,3 @@ Creates a border animation on hover.
#### Explanation #### Explanation
- Use the `:before` and `:after` pseudo-elements as borders that animate on hover. - Use the `:before` and `:after` pseudo-elements as borders that animate on hover.
#### Browser support

View File

@ -22,5 +22,3 @@ Creates a circle shape with pure CSS.
- `border-radius: 50%` curves the borders of an element to create a circle. - `border-radius: 50%` curves the borders of an element to create a circle.
- Since a circle has the same radius at any given point, the `width` and `height` must be the same. Differing values will create an ellipse. - Since a circle has the same radius at any given point, the `width` and `height` must be the same. Differing values will create an ellipse.
#### Browser support

View File

@ -27,12 +27,7 @@ Ensures that an element self-clears its children.
#### Explanation #### Explanation
1. `.clearfix:after` defines a pseudo-element. - `.clearfix:after` defines a pseudo-element.
2. `content: ''` allows the pseudo-element to affect layout. - `content: ''` allows the pseudo-element to affect layout.
3. `clear: both` indicates that the left, right or both sides of the element cannot be adjacent to earlier floated elements within the same block formatting context. - `clear: both` indicates that the left, right or both sides of the element cannot be adjacent to earlier floated elements within the same block formatting context.
- This is only useful if you are still using `float` to build layouts. Please consider using a modern approach with flexbox layout or grid layout. For this snippet to work properly you need to ensure that there are no non-floating children in the container and that there are no tall floats before the clearfixed container but in the same formatting context (e.g. floated columns).
_Note: This is only useful if you are still using `float` to build layouts. Please consider using a modern approach with flexbox layout or grid layout._
#### Browser support
<span class="snippet__support-note">⚠️ For this snippet to work properly you need to ensure that there are no non-floating children in the container and that there are no tall floats before the clearfixed container but in the same formatting context (e.g. floated columns).</span>

View File

@ -32,5 +32,3 @@ Given an element of variable width, it will ensure its `height` remains proporti
- `padding-top` on the `:before` pseudo-element causes the height of the element to equal a percentage of its width. `100%` therefore means the element's height will always be `100%` of the width, creating a responsive square. - `padding-top` on the `:before` pseudo-element causes the height of the element to equal a percentage of its width. `100%` therefore means the element's height will always be `100%` of the width, creating a responsive square.
- This method also allows content to be placed inside the element normally. - This method also allows content to be placed inside the element normally.
#### Browser support

View File

@ -35,10 +35,8 @@ li:before {
You can create a ordered list using any type of HTML. You can create a ordered list using any type of HTML.
1. `counter-reset` is used to initialize a counter, the name of which is the value of the attribute. By default, the counter starts at `0`. This property can also be used to change its value to any specific number. - `counter-reset` is used to initialize a counter, the name of which is the value of the attribute. By default, the counter starts at `0`. This property can also be used to change its value to any specific number.
2. `counter-increment` is used for an element that will be countable. Once `counter-reset` is initialized, a counter's value can be increased or decreased. - `counter-increment` is used for an element that will be countable. Once `counter-reset` is initialized, a counter's value can be increased or decreased.
3. `counter(name, style)` displays the value of a section counter. Generally used with the `content` property. This function can receive two parameters, the first being the name of the counter and the second one either `decimal` or `upper-roman` (`decimal` by default). - `counter(name, style)` displays the value of a section counter. Generally used with the `content` property. This function can receive two parameters, the first being the name of the counter and the second one either `decimal` or `upper-roman` (`decimal` by default).
4. `counters(counter, string, style)` displays the value of a section counter. Generally used with the `content` property. This function can receive three parameters, the first as the name of the counter, the second one you can include a string which comes after the counter and the third one can be `decimal` or `upper-roman` (`decimal` by default). - `counters(counter, string, style)` displays the value of a section counter. Generally used with the `content` property. This function can receive three parameters, the first as the name of the counter, the second one you can include a string which comes after the counter and the third one can be `decimal` or `upper-roman` (`decimal` by default).
5. A CSS counter can be especially useful for making outlined lists, because a new instance of the counter is automatically created in child elements. Using the `counters()` function, separating text can be inserted between different levels of nested counters. - A CSS counter can be especially useful for making outlined lists, because a new instance of the counter is automatically created in child elements. Using the `counters()` function, separating text can be inserted between different levels of nested counters.
#### Browser support

View File

@ -43,11 +43,4 @@ Customizes the scrollbar style for the document and elements with scrollable ove
- `::-webkit-scrollbar-track` targets only the scrollbar track. - `::-webkit-scrollbar-track` targets only the scrollbar track.
- `::-webkit-scrollbar-thumb` targets the scrollbar thumb. - `::-webkit-scrollbar-thumb` targets the scrollbar thumb.
- Apply the same selectors and styles without `.custom-scrollbar` to style the document scrollbar. - Apply the same selectors and styles without `.custom-scrollbar` to style the document scrollbar.
- Scrollbar styling doesn't appear to be on any standards track. There are many other pseudo-elements that you can use to style scrollbars. For more info, visit the [WebKit Blog](https://webkit.org/blog/363/styling-scrollbars/).
There are many other pseudo-elements that you can use to style scrollbars. For more info, visit the [WebKit Blog](https://webkit.org/blog/363/styling-scrollbars/).
#### Browser support
<span class="snippet__support-note">⚠️ Scrollbar styling doesn't appear to be on any standards track.</span>
- https://caniuse.com/#feat=css-scrollbar

View File

@ -24,9 +24,4 @@ Changes the styling of text selection.
#### Explanation #### Explanation
- `::selection` defines a pseudo selector on an element to style text within it when selected. Note that if you don't combine any other selector your style will be applied at document root level, to any selectable element. - `::selection` defines a pseudo selector on an element to style text within it when selected. Note that if you don't combine any other selector your style will be applied at document root level, to any selectable element.
- Requires prefixes for full support and is not actually in any specification.
#### Browser support
<span class="snippet__support-note">⚠️ Requires prefixes for full support and is not actually in any specification.</span>
- https://caniuse.com/#feat=css-selection

View File

@ -19,9 +19,4 @@ Makes the content unselectable.
#### Explanation #### Explanation
- `user-select: none` specifies that the text cannot be selected. - `user-select: none` specifies that the text cannot be selected.
- This is not a secure method to prevent users from copying content.
_Note: This is not a secure method to prevent users from copying content._
#### Browser support
- https://caniuse.com/#feat=user-select-none

View File

@ -39,5 +39,3 @@ Vertically and horizontally centers a child element within its parent element us
- `text-align: center` on '.center > span' centers the child element horizontally. - `text-align: center` on '.center > span' centers the child element horizontally.
- `vertical-align: middle` on '.center > span' centers the child element vertically. - `vertical-align: middle` on '.center > span' centers the child element vertically.
- The outer parent ('.container' in this case) must have a fixed height and width. - The outer parent ('.container' in this case) must have a fixed height and width.
#### Browser support

View File

@ -33,5 +33,3 @@ Creates a donut spinner that can be used to indicate the loading of content.
#### Explanation #### Explanation
- Use a semi-transparent `border` for the whole element, except one side that will serve as the loading indicator for the donut. Use `animation` to rotate the element. - Use a semi-transparent `border` for the whole element, except one side that will serve as the loading indicator for the donut. Use `animation` to rotate the element.
#### Browser support

View File

@ -24,5 +24,3 @@ p:first-child::first-letter {
#### Explanation #### Explanation
- Use the `::first-letter` pseudo-element to style the first element of the paragraph, use the `:first-child` selector to select only the first paragraph. - Use the `::first-letter` pseudo-element to style the first element of the paragraph, use the `:first-child` selector to select only the first paragraph.
#### Browser support

View File

@ -43,5 +43,3 @@ Creates a shadow similar to `box-shadow` but based on the colors of the element
- `filter: blur(0.4rem)` will blur the pseudo-element to create the appearance of a shadow underneath. - `filter: blur(0.4rem)` will blur the pseudo-element to create the appearance of a shadow underneath.
- `opacity: 0.7` makes the pseudo-element partially transparent. - `opacity: 0.7` makes the pseudo-element partially transparent.
- `z-index: -1` positions the pseudo-element behind the parent but in front of the background. - `z-index: -1` positions the pseudo-element behind the parent but in front of the background.
#### Browser support

View File

@ -55,7 +55,3 @@ Variables that can be reused for `transition-timing-function` properties, more p
- The variables are defined globally within the `:root` CSS pseudo-class which matches the root element of a tree representing the document. - The variables are defined globally within the `:root` CSS pseudo-class which matches the root element of a tree representing the document.
- In HTML, `:root` represents the `<html>` element and is identical to the selector `html`, except that its specificity is higher. - In HTML, `:root` represents the `<html>` element and is identical to the selector `html`, except that its specificity is higher.
#### Browser support
- https://caniuse.com/#feat=css-variables

View File

@ -23,5 +23,3 @@ Creates an effect where text appears to be "etched" or engraved into the backgro
- `text-shadow: 0 2px white` creates a white shadow offset `0px` horizontally and `2px` vertically from the origin position. - `text-shadow: 0 2px white` creates a white shadow offset `0px` horizontally and `2px` vertically from the origin position.
- The background must be darker than the shadow for the effect to work. - The background must be darker than the shadow for the effect to work.
- The text color should be slightly faded to make it look like it's engraved/carved out of the background. - The text color should be slightly faded to make it look like it's engraved/carved out of the background.
#### Browser support

View File

@ -22,9 +22,7 @@ Evenly distributes child elements within a parent element.
#### Explanation #### Explanation
1. `display: flex` enables flexbox. - `display: flex` enables flexbox.
2. `justify-content: space-between` evenly distributes child elements horizontally. The first item is positioned at the left edge, while the last item is positioned at the right edge. - `justify-content: space-between` evenly distributes child elements horizontally. The first item is positioned at the left edge, while the last item is positioned at the right edge.
- Alternatively, use `justify-content: space-around` to distribute the children with space around them, rather than between them.
_Note: Alternatively, use `justify-content: space-around` to distribute the children with space around them, rather than between them._
#### Browser support

View File

@ -34,5 +34,3 @@ Changes the fit and position of an image within its container while preserving i
- `object-fit: contain` fits the entire image within the container while preserving its aspect ratio. - `object-fit: contain` fits the entire image within the container while preserving its aspect ratio.
- `object-fit: cover` fills the container with the image while preserving its aspect ratio. - `object-fit: cover` fills the container with the image while preserving its aspect ratio.
- `object-position: [x] [y]` positions the image within the container. - `object-position: [x] [y]` positions the image within the container.
#### Browser support

View File

@ -25,5 +25,3 @@ Horizontally and vertically centers a child element within a parent element usin
- `display: flex` creates a flexbox layout. - `display: flex` creates a flexbox layout.
- `justify-content: center` centers the child horizontally. - `justify-content: center` centers the child horizontally.
- `align-items: center` centers the child vertically. - `align-items: center` centers the child vertically.
#### Browser support

View File

@ -39,9 +39,3 @@ input {
#### Explanation #### Explanation
- The psuedo class `:focus-within` applies styles to a parent element if any child element gets focused. For example, an `input` element inside a `form` element. - The psuedo class `:focus-within` applies styles to a parent element if any child element gets focused. For example, an `input` element inside a `form` element.
#### Browser support
<span class="snippet__support-note">⚠️ Not supported in IE11 or the current version of Edge.</span>
- https://caniuse.com/#feat=css-focus-within

View File

@ -50,8 +50,3 @@ The `:fullscreen` CSS pseudo-element represents an element that's displayed when
#### Explanation #### Explanation
- `:fullscreen` CSS pseudo-element selector is used to select and style an element that is being displayed in fullscreen mode. - `:fullscreen` CSS pseudo-element selector is used to select and style an element that is being displayed in fullscreen mode.
#### Browser support
- https://developer.mozilla.org/en-US/docs/Web/CSS/:fullscreen
- https://caniuse.com/#feat=fullscreen

View File

@ -23,9 +23,4 @@ Gives text a gradient color.
- `background: -webkit-linear-gradient(...)` gives the text element a gradient background. - `background: -webkit-linear-gradient(...)` gives the text element a gradient background.
- `webkit-text-fill-color: transparent` fills the text with a transparent color. - `webkit-text-fill-color: transparent` fills the text with a transparent color.
- `webkit-background-clip: text` clips the background with the text, filling the text with the gradient background as the color. - `webkit-background-clip: text` clips the background with the text, filling the text with the gradient background as the color.
- Uses non-standard properties.
#### Browser support
<span class="snippet__support-note">⚠️ Uses non-standard properties.</span>
- https://caniuse.com/#feat=text-stroke

View File

@ -22,10 +22,6 @@ Horizontally and vertically centers a child element within a parent element usin
#### Explanation #### Explanation
1. `display: grid` creates a grid layout - `display: grid` creates a grid layout
2. `justify-content: center` centers the child horizontally. - `justify-content: center` centers the child horizontally.
3. `align-items: center` centers the child vertically. - `align-items: center` centers the child vertically.
#### Browser support
- https://caniuse.com/#feat=css-grid

View File

@ -54,5 +54,3 @@ Displays a hamburger menu which transitions to a cross on hover.
- The animation has 3 parts: top and bottom bars transforming to 45 degree angles (`rotate(45deg)`), and the middle bar fading away by setting `opacity: 0`. - The animation has 3 parts: top and bottom bars transforming to 45 degree angles (`rotate(45deg)`), and the middle bar fading away by setting `opacity: 0`.
- The `transform-origin` is set to `left` so the bars rotate around the left point. - The `transform-origin` is set to `left` so the bars rotate around the left point.
- Set `transition all 0.5s` so that both `transform` and `opacity` properties are animated for half a second. - Set `transition all 0.5s` so that both `transform` and `opacity` properties are animated for half a second.
#### Browser support

View File

@ -38,11 +38,4 @@ el.style.setProperty('--max-height', height + 'px');
- `.target:hover > .el` specifies that when the parent is hovered over, target a child `.el` within it and use the `--max-height` variable which was defined by JavaScript. - `.target:hover > .el` specifies that when the parent is hovered over, target a child `.el` within it and use the `--max-height` variable which was defined by JavaScript.
- `el.scrollHeight` is the height of the element including overflow, which will change dynamically based on the content of the element. - `el.scrollHeight` is the height of the element including overflow, which will change dynamically based on the content of the element.
- `el.style.setProperty(...)` sets the `--max-height` CSS variable which is used to specify the `max-height` of the element the target is hovered over, allowing it to transition smoothly from 0 to auto. - `el.style.setProperty(...)` sets the `--max-height` CSS variable which is used to specify the `max-height` of the element the target is hovered over, allowing it to transition smoothly from 0 to auto.
- Causes reflow on each animation frame, which will be laggy if there are a large number of elements beneath the element that is transitioning in height.
#### Browser Support
<div class="snippet__requires-javascript">Requires JavaScript</div>
<span class="snippet__support-note">⚠️ Causes reflow on each animation frame, which will be laggy if there are a large number of elements beneath the element that is transitioning in height.</span>
- https://caniuse.com/#feat=css-variables
- https://caniuse.com/#feat=css-transitions

View File

@ -37,5 +37,3 @@ Creates a shadow box around the text when it is hovered.
- `transition-property` to enable transitions for both `box-shadow` and `transform`. - `transition-property` to enable transitions for both `box-shadow` and `transform`.
- `:hover` to activate whole css when hovering is done until `active`. - `:hover` to activate whole css when hovering is done until `active`.
- `transform: scale(1.2)` to change the scale, magnifying the text. - `transform: scale(1.2)` to change the scale, magnifying the text.
#### Browser Support

View File

@ -47,5 +47,3 @@ Creates an animated underline effect when the text is hovered over.
- `transition: transform 0.25s ease-out` means changes to `transform` will be transitioned over 0.25 seconds with an `ease-out` timing function. - `transition: transform 0.25s ease-out` means changes to `transform` will be transitioned over 0.25 seconds with an `ease-out` timing function.
- `transform-origin: bottom right` means the transform anchor point is positioned at the bottom right of the block. - `transform-origin: bottom right` means the transform anchor point is positioned at the bottom right of the block.
- `:hover:after` then uses `scaleX(1)` to transition the width to 100%, then changes the `transform-origin` to `bottom left` so that the anchor point is reversed, allowing it transition out in the other direction when hovered off. - `:hover:after` then uses `scaleX(1)` to transition the width to 100%, then changes the `transform-origin` to `bottom left` so that the anchor point is reversed, allowing it transition out in the other direction when hovered off.
#### Browser support

View File

@ -89,5 +89,3 @@ Displays a menu overlay when the image is hovered.
- Use the `opacity` and `right` attributes to animate the image on hover, to create a sliding effect. - Use the `opacity` and `right` attributes to animate the image on hover, to create a sliding effect.
- Set the `left` attribute of the `div` to the negative of the element's `width` and reset it to `0` when hovering over the parent element to slide in the menu. - Set the `left` attribute of the `div` to the negative of the element's `width` and reset it to `0` when hovering over the parent element to slide in the menu.
- Use `display: flex`, `flex-direction: column` and `justify-content: center` on the `div` to vertically center the menu items. - Use `display: flex`, `flex-direction: column` and `justify-content: center` on the `div` to vertically center the menu items.
#### Browser support

View File

@ -35,5 +35,3 @@ Creates a rotate effect for the image on hover.
- Use `scale` and `rotate` when hovering over the parent element (a `figure`) to animate the image, using the `transition` property. - Use `scale` and `rotate` when hovering over the parent element (a `figure`) to animate the image, using the `transition` property.
- Use `overflow: hidden` on the parent container to hide the excess from the image transformation. - Use `overflow: hidden` on the parent container to hide the excess from the image transformation.
#### Browser support

View File

@ -98,5 +98,3 @@ Displays an image overlay effect on hover.
- Use the `:before` and `:after` elements for the top and bottom bars of the overlay respectively, setting their `opacity`, `transform` and `transition` to produce the desired effect. - Use the `:before` and `:after` elements for the top and bottom bars of the overlay respectively, setting their `opacity`, `transform` and `transition` to produce the desired effect.
- Use the `figcaption` for the text of the overlay, setting `display: flex`, `flex-direction: column` and `justify-content: center` to center the text into the image. - Use the `figcaption` for the text of the overlay, setting `display: flex`, `flex-direction: column` and `justify-content: center` to center the text into the image.
- Use the `:hover` pseudo-selector to update the `opacity` and `transform` of all the elements and produce the desired effect. - Use the `:hover` pseudo-selector to update the `opacity` and `transform` of all the elements and produce the desired effect.
#### Browser support

View File

@ -68,5 +68,3 @@ Creates a vertical masonry layout using HTML and CSS.
- `.masonry-container` is the container for the masonry layout. Within that container, there's a `div.masonry-columns`, which will automatically put each child element, `.masonry-brick`, into the layout. - `.masonry-container` is the container for the masonry layout. Within that container, there's a `div.masonry-columns`, which will automatically put each child element, `.masonry-brick`, into the layout.
- `.masonry-brick` must be have `display: block` to allow the layout to flow properly, while the `:first-child` of this class should have a different `margin` to account for its positioning. - `.masonry-brick` must be have `display: block` to allow the layout to flow properly, while the `:first-child` of this class should have a different `margin` to account for its positioning.
- CSS variables are used to allow for greater flexibility for the layout, while media queries ensure that the layout flows responsively in different viewport sizes. - CSS variables are used to allow for greater flexibility for the layout, while media queries ensure that the layout flows responsively in different viewport sizes.
#### Browser support

View File

@ -62,7 +62,3 @@ btn.onmousemove = function(e) {
- `--x` and `--y` are used to track the position of the mouse on the button. - `--x` and `--y` are used to track the position of the mouse on the button.
- `--size` is used to keep modify of the gradient's dimensions. - `--size` is used to keep modify of the gradient's dimensions.
- `background: radial-gradient(circle closest-side, pink, transparent);` creates the gradient at the correct postion. - `background: radial-gradient(circle closest-side, pink, transparent);` creates the gradient at the correct postion.
#### Browser support
- https://caniuse.com/#feat=css-variables

View File

@ -60,5 +60,3 @@ li a:focus:before {
- Use the `:before` pseudo-element at the list item anchor to create a hover effect, hide it using `transform: scale(0)`. - Use the `:before` pseudo-element at the list item anchor to create a hover effect, hide it using `transform: scale(0)`.
- Use the `:hover` and `:focus` pseudo-selectors to transition to `transform: scale(1)` and show the pseudo-element with its colored background. - Use the `:hover` and `:focus` pseudo-selectors to transition to `transform: scale(1)` and show the pseudo-element with its colored background.
- Prevent the pseudo-element from covering the anchor element by using `z-index: -1`. - Prevent the pseudo-element from covering the anchor element by using `z-index: -1`.
#### Browser support

View File

@ -34,7 +34,3 @@ Provides an alternative to `display: none` (not readable by screen readers) and
- Hide the element's overflow. - Hide the element's overflow.
- Remove all padding. - Remove all padding.
- Position the element absolutely so that it does not take up space in the DOM. - Position the element absolutely so that it does not take up space in the DOM.
#### Browser support
- https://caniuse.com/#search=clip

View File

@ -55,5 +55,3 @@ Adds a fading gradient to an overflowing element to better indicate there is mor
- `height: 25px` is the height of the fading gradient pseudo-element, which should be kept relatively small. - `height: 25px` is the height of the fading gradient pseudo-element, which should be kept relatively small.
- `bottom: 0` positions the pseudo-element at the bottom of the parent. - `bottom: 0` positions the pseudo-element at the bottom of the parent.
- `pointer-events: none` specifies that the pseudo-element cannot be a target of mouse events, allowing text behind it to still be selectable/interactive. - `pointer-events: none` specifies that the pseudo-element cannot be a target of mouse events, allowing text behind it to still be selectable/interactive.
#### Browser support

View File

@ -44,5 +44,3 @@ Reveals an interactive popout menu on hover and focus.
- `.reference:hover > .popout-menu` means that when `.reference` is hovered over, select immediate children with a class of `.popout-menu` and change their `visibility` to `visible`, which shows the popout. - `.reference:hover > .popout-menu` means that when `.reference` is hovered over, select immediate children with a class of `.popout-menu` and change their `visibility` to `visible`, which shows the popout.
- `.reference:focus > .popout-menu` means that when `.reference` is focused, the popout would be shown. - `.reference:focus > .popout-menu` means that when `.reference` is focused, the popout would be shown.
- `.reference:focus-within > .popout-menu` ensures that the popout is shown when the focus is _within_ the reference. - `.reference:focus-within > .popout-menu` ensures that the popout is shown when the focus is _within_ the reference.
#### Browser support

View File

@ -37,5 +37,3 @@ Natively implemented as `text-decoration-skip-ink: auto` but it has less control
- `background-image: linear-gradient(...)` creates a 90deg gradient using the text color (`currentColor`). - `background-image: linear-gradient(...)` creates a 90deg gradient using the text color (`currentColor`).
- The `background-*` properties size the gradient as 100% of the width of the block and 1px in height at the bottom and disables repetition, which creates a 1px underline beneath the text. - The `background-*` properties size the gradient as 100% of the width of the block and 1px in height at the bottom and disables repetition, which creates a 1px underline beneath the text.
- The `::selection` pseudo selector rule ensures the text shadow does not interfere with text selection. - The `::selection` pseudo selector rule ensures the text shadow does not interfere with text selection.
#### Browser support

View File

@ -54,7 +54,3 @@ Creates a pulse effect loader animation using the `animation-delay` property.
- Use `opacity` to transition from `1` to `0` when animating to give the `<div>` elements a disappearing effect as they expand. - Use `opacity` to transition from `1` to `0` when animating to give the `<div>` elements a disappearing effect as they expand.
- `.ripple-loader`, which is the parent container, has a predefined `width` and `height`. It uses `position: relative` to position its children. - `.ripple-loader`, which is the parent container, has a predefined `width` and `height`. It uses `position: relative` to position its children.
- Use `animation-delay` on the second `<div>` element, so that each element starts its animation at a different time. - Use `animation-delay` on the second `<div>` element, so that each element starts its animation at a different time.
#### Browser support
- https://caniuse.com/#feat=css-animation

View File

@ -25,9 +25,3 @@ Resets all styles to default values with one property. This will not affect `dir
#### Explanation #### Explanation
- The `all` property allows you to reset all styles (inherited or not) to default values. - The `all` property allows you to reset all styles (inherited or not) to default values.
#### Browser support
<span class="snippet__support-note">⚠️ MS Edge status is under consideration.</span>
- https://caniuse.com/#feat=css-all

View File

@ -35,7 +35,3 @@ Uses an SVG shape to separate two different blocks to create more a interesting
- `width: 100%` ensures the element stretches the entire width of its parent. - `width: 100%` ensures the element stretches the entire width of its parent.
- `height: 12px` is the same height as the shape. - `height: 12px` is the same height as the shape.
- `bottom: 0` positions the pseudo element at the bottom of the parent. - `bottom: 0` positions the pseudo element at the bottom of the parent.
#### Browser support
- https://caniuse.com/#feat=svg

View File

@ -27,8 +27,3 @@ span {
- `transition: opacity 0.2s` specifies that changes to opacity will be transitioned over 0.3 seconds. - `transition: opacity 0.2s` specifies that changes to opacity will be transitioned over 0.3 seconds.
- `.sibling-fade:hover span:not(:hover)` specifies that when the parent is hovered, select any `span` children that are not currently being hovered and change their opacity to `0.5`. - `.sibling-fade:hover span:not(:hover)` specifies that when the parent is hovered, select any `span` children that are not currently being hovered and change their opacity to `0.5`.
#### Browser support
- https://caniuse.com/#feat=css-sel3
- https://caniuse.com/#feat=css-transitions

View File

@ -64,8 +64,3 @@ Creates a staggered animation for the elements of a list.
- Specify the appropriate `transition` properties for list elements, except `transition-delay` which is specified relative to the `--i` custom property. - Specify the appropriate `transition` properties for list elements, except `transition-delay` which is specified relative to the `--i` custom property.
- Use inline styles to specify a value for `--i` for each list element, which will in turn be used for `transition-delay` to create the stagger effect. - Use inline styles to specify a value for `--i` for each list element, which will in turn be used for `transition-delay` to create the stagger effect.
- Use the `:checked` selector for the checkbox to appropriately style list elements, setting `opacity` to `1` and `transform` to `translateX(0)` to make them appear and slide into view. - Use the `:checked` selector for the checkbox to appropriately style list elements, setting `opacity` to `1` and `transform` to `translateX(0)` to make them appear and slide into view.
#### Browser support
- https://caniuse.com/#feat=css-variables
- https://caniuse.com/#feat=css-transitions

View File

@ -30,5 +30,3 @@ The browser looks for each successive font, preferring the first one if possible
- `"Helvetica Neue"` and `Helvetica` is used on macOS 10.10 and below (wrapped in quotes because it has a space) - `"Helvetica Neue"` and `Helvetica` is used on macOS 10.10 and below (wrapped in quotes because it has a space)
- `Arial` is a font widely supported by all operating systems - `Arial` is a font widely supported by all operating systems
- `sans-serif` is the fallback sans-serif font if none of the other fonts are supported - `sans-serif` is the fallback sans-serif font if none of the other fonts are supported
#### Browser support

View File

@ -46,5 +46,3 @@ Align items horizontally using `display: inline-block` to create a 3-tile layout
- Use `width: calc((900px / 3))` to divide the width of the container evenly into 3 columns. - Use `width: calc((900px / 3))` to divide the width of the container evenly into 3 columns.
- Set `font-size: 0;` on `.tiles` to avoid whitespace. - Set `font-size: 0;` on `.tiles` to avoid whitespace.
- Set `font-size: 20px` to `h2` in order to display the text. - Set `font-size: 20px` to `h2` in order to display the text.
#### Browser support

View File

@ -57,5 +57,3 @@ This effect is styling only the `<label>` element to look like a toggle switch,
- `background-color: #7983ff;` sets the background-color of the switch to a different color when the checkbox is `checked`. - `background-color: #7983ff;` sets the background-color of the switch to a different color when the checkbox is `checked`.
- `.offscreen` moves the `<input>` checkbox element, which does not comprise any part of the actual toggle switch, out of the flow of document and positions it far away from the view, but does not hide it so it is accessible via keyboard and screen readers. - `.offscreen` moves the `<input>` checkbox element, which does not comprise any part of the actual toggle switch, out of the flow of document and positions it far away from the view, but does not hide it so it is accessible via keyboard and screen readers.
- `transition: all 0.3s` specifies all property changes will be transitioned over 0.3 seconds, therefore transitioning the `<label>`'s `background-color` and the pseudo-element's `transform` property when the checkbox is checked. - `transition: all 0.3s` specifies all property changes will be transitioned over 0.3 seconds, therefore transitioning the `<label>`'s `background-color` and the pseudo-element's `transform` property when the checkbox is checked.
#### Browser support

View File

@ -33,7 +33,4 @@ Vertically and horizontally centers a child element within its parent element us
- `position: absolute` on the child element allows it to be positioned based on its containing block. - `position: absolute` on the child element allows it to be positioned based on its containing block.
- `left: 50%` and `top: 50%` offsets the child 50% from the left and top edge of its containing block. - `left: 50%` and `top: 50%` offsets the child 50% from the left and top edge of its containing block.
- `transform: translate(-50%, -50%)` allows the height and width of the child element to be negated so that it is vertically and horizontally centered. - `transform: translate(-50%, -50%)` allows the height and width of the child element to be negated so that it is vertically and horizontally centered.
- Note that the fixed height and width on parent element is for the demo only.
- Note: that the fixed height and width on parent element is for the demo only.
#### Browser support

View File

@ -23,5 +23,3 @@ Creates a triangle shape with pure CSS.
- The color of the border is the color of the triangle. The side the triangle tip points corresponds to the opposite `border-*` property. For example, a color on `border-top` means the arrow points downward. - The color of the border is the color of the triangle. The side the triangle tip points corresponds to the opposite `border-*` property. For example, a color on `border-top` means the arrow points downward.
- Experiment with the `px` values to change the proportion of the triangle. - Experiment with the `px` values to change the proportion of the triangle.
#### Browser support

View File

@ -42,5 +42,3 @@ If the text is longer than one line, it will be truncated for `n` lines and end
- `height: 109.2px` calculated value for height, it equals `font-size * line-height * numberOfLines` (in this case `26 * 1.4 * 3 = 109.2`) - `height: 109.2px` calculated value for height, it equals `font-size * line-height * numberOfLines` (in this case `26 * 1.4 * 3 = 109.2`)
- `height: 36.4px` calculated value for gradient container, it equals `font-size * line-height` (in this case `26 * 1.4 = 36.4`) - `height: 36.4px` calculated value for gradient container, it equals `font-size * line-height` (in this case `26 * 1.4 = 36.4`)
- `background: linear-gradient(to right, rgba(0, 0, 0, 0), #f5f6f9 50%)` gradient from `transparent` to `#f5f6f9` - `background: linear-gradient(to right, rgba(0, 0, 0, 0), #f5f6f9 50%)` gradient from `transparent` to `#f5f6f9`
#### Browser support

View File

@ -24,7 +24,4 @@ If the text is longer than one line, it will be truncated and end with an ellips
- `white-space: nowrap` prevents the text from exceeding one line in height. - `white-space: nowrap` prevents the text from exceeding one line in height.
- `text-overflow: ellipsis` makes it so that if the text exceeds its dimensions, it will end with an ellipsis. - `text-overflow: ellipsis` makes it so that if the text exceeds its dimensions, it will end with an ellipsis.
- `width: 200px;` ensures the element has a dimension, to know when to get ellipsis - `width: 200px;` ensures the element has a dimension, to know when to get ellipsis
- Only works for single line elements.
#### Browser support
<span class="snippet__support-note">⚠️ Only works for single line elements.</span>

View File

@ -25,5 +25,3 @@ li:nth-child(odd) {
- Use the `:nth-child(odd)` or `:nth-child(even)` pseudo-class to apply a different background color to elements that match based on their position in a group of siblings. - Use the `:nth-child(odd)` or `:nth-child(even)` pseudo-class to apply a different background color to elements that match based on their position in a group of siblings.
- Note that you can use it to apply different styles to other HTML elements like `div`, `tr`, `p`, `ol`, etc. - Note that you can use it to apply different styles to other HTML elements like `div`, `tr`, `p`, `ol`, etc.
#### Browser support