@@ -20,7 +19,7 @@ Vertically and horizontally centers a child element within its parent element us
```css
.container {
- border: 1px solid #333;
+ border: 1px solid #9C27B0;
height: 250px;
width: 250px;
}
diff --git a/snippets/donut-spinner.md b/snippets/donut-spinner.md
index 0bc8f664e..0767472ac 100644
--- a/snippets/donut-spinner.md
+++ b/snippets/donut-spinner.md
@@ -5,7 +5,8 @@ tags: animation,intermediate
Creates a donut spinner that can be used to indicate the loading of content.
-- 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.
+- Define and use an appropriate animation, using `transform: rotate()` to rotate the element.
```html
diff --git a/snippets/drop-cap.md b/snippets/drop-cap.md
index fa7636dcd..24e770318 100644
--- a/snippets/drop-cap.md
+++ b/snippets/drop-cap.md
@@ -3,9 +3,10 @@ title: Drop cap
tags: visual,beginner
---
-Makes the first letter in the first paragraph bigger than the rest of the text - often used to signify the beginning of a new section.
+Makes the first letter of the first paragraph bigger than the rest of the text.
-- 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-child` selector to select only the first paragraph.
+- Use the `::first-letter` pseudo-element to style the first element of the paragraph.
```html
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam commodo ligula quis tincidunt cursus. Integer consectetur tempor ex eget hendrerit. Cras facilisis sodales odio nec maximus. Pellentesque lacinia convallis libero, rhoncus tincidunt ante dictum at. Nullam facilisis lectus tellus, sit amet congue erat sodales commodo.
diff --git a/snippets/dynamic-shadow.md b/snippets/dynamic-shadow.md
index fc4f202cd..93a60f846 100644
--- a/snippets/dynamic-shadow.md
+++ b/snippets/dynamic-shadow.md
@@ -5,16 +5,10 @@ tags: visual,intermediate
Creates a shadow similar to `box-shadow` but based on the colors of the element itself.
-- `position: relative` on the element establishes a Cartesian positioning context for psuedo-elements.
-- `z-index: 1` establishes a new stacking context.
-- `:after` defines a pseudo-element.
-- `position: absolute` takes the pseudo element out of the flow of the document and positions it in relation to the parent.
-- `width: 100%` and `height: 100%` sizes the pseudo-element to fill its parent's dimensions, making it equal in size.
-- `background: inherit` causes the pseudo-element to inherit the linear gradient specified on the element.
-- `top: 0.5rem` offsets the pseudo-element down slightly from its parent.
-- `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.
-- `z-index: -1` positions the pseudo-element behind the parent but in front of the background.
+- Use the `:after` pseudo-element with `position: absolute` and `width` and `height` equal to `100%` to fill the available space in the parent element.
+- Use `background: inherit` to inherit the `background` of the parent element.
+- Use `top` to slightly offset the pseudo-element, `filter: blur()` to create a shadow and `opacity` to make it semi-transparent.
+- Use `z-index: 1` on the parent and `z-index: -1` on the pseudo-element to position it behind its parent.
```html
diff --git a/snippets/easing-variables.md b/snippets/easing-variables.md
index 02262c92d..9a499bcc0 100644
--- a/snippets/easing-variables.md
+++ b/snippets/easing-variables.md
@@ -3,10 +3,10 @@ title: Easing variables
tags: animation,beginner
---
-Variables that can be reused for `transition-timing-function` properties, more powerful than the built-in `ease`, `ease-in`, `ease-out` and `ease-in-out`.
+List of variables that can be reused for `transition-timing-function` properties.
-- 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 `` element and is identical to the selector `html`, except that its specificity is higher.
+- Use the custom property syntax to define appropriate timing functions for transitions.
+- The variables can be defined globally within the `:root` CSS pseudo-class which matches the root element of a tree representing the document or inside any other selector.
```html
Hover
@@ -45,7 +45,7 @@ Variables that can be reused for `transition-timing-function` properties, more p
color: white;
line-height: 50px;
text-align: center;
- background: #333;
+ background: #9C27B0;
transition: transform 1s var(--ease-out-quart);
}
diff --git a/snippets/etched-text.md b/snippets/etched-text.md
index e49c00377..4f8304768 100644
--- a/snippets/etched-text.md
+++ b/snippets/etched-text.md
@@ -5,7 +5,7 @@ tags: visual,intermediate
Creates an effect where text appears to be "etched" or engraved into the background.
-- `text-shadow: 0 2px white` creates a white shadow offset `0px` horizontally and `2px` vertically from the origin position.
+- Use `text-shadow` to create 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 text color should be slightly faded to make it look like it's engraved/carved out of the background.
diff --git a/snippets/evenly-distributed-children.md b/snippets/evenly-distributed-children.md
index b249fad21..66d513163 100644
--- a/snippets/evenly-distributed-children.md
+++ b/snippets/evenly-distributed-children.md
@@ -5,9 +5,9 @@ tags: layout,intermediate
Evenly distributes child elements within a parent element.
-- `display: flex` enables flexbox.
-- `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.
+- Use `display: flex` to use the flexbox layout.
+- Use `justify-content: space-between` to 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, you can use `justify-content: space-around` to distribute the children with space around them, rather than between them.
```html
diff --git a/snippets/fit-image-in-container.md b/snippets/fit-image-in-container.md
index 0c7e2f0ea..c38a59917 100644
--- a/snippets/fit-image-in-container.md
+++ b/snippets/fit-image-in-container.md
@@ -3,11 +3,11 @@ title: Fit image in container
tags: layout,visual,intermediate
---
-Changes the fit and position of an image within its container while preserving its aspect ratio. Previously only possible using a background image and the `background-size` property.
+Fits an positions an image appropriately inside its 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-position: [x] [y]` positions the image within the container.
+- Use `object-fit: contain` to fit the entire image within the container while preserving its aspect ratio.
+- Use `object-fit: cover` to fill the container with the image while preserving its aspect ratio.
+- Use `object-position: center` to position the image at the center of the container.
```html

diff --git a/snippets/flexbox-centering.md b/snippets/flexbox-centering.md
index cae71d182..b78a9ac4e 100644
--- a/snippets/flexbox-centering.md
+++ b/snippets/flexbox-centering.md
@@ -3,11 +3,11 @@ title: Flexbox centering
tags: layout,beginner
---
-Horizontally and vertically centers a child element within a parent element using `flexbox`.
+Horizontally and vertically centers a child element within a parent element using flexbox.
-- `display: flex` creates a flexbox layout.
-- `justify-content: center` centers the child horizontally.
-- `align-items: center` centers the child vertically.
+- Use `display: flex` to create a flexbox layout.
+- Use `justify-content: center` to center the child horizontally.
+- Use `align-items: center` to center the child vertically.
```html
diff --git a/snippets/floating-list-titles.md b/snippets/floating-list-titles.md
index fe9f00135..0d1e1af3e 100644
--- a/snippets/floating-list-titles.md
+++ b/snippets/floating-list-titles.md
@@ -6,8 +6,8 @@ tags: visual,advanced
Creates a list with floating headings for each section.
- Use `overflow-y: auto` to allow the list container to overflow vertically.
-- Use `display: grid` on the inner container (`dl`) to create a layout with two columns.
-- Set headings (`dt`) to `grid-column: 1` and content (`dd`) to `grid-column: 2`
+- Use `display: grid` on the inner container (`
`) to create a layout with two columns.
+- Set headings (`- `) to `grid-column: 1` and content (`
- `) to `grid-column: 2`
- Finally, apply `position: sticky` and `top: 0.5rem` to headings to create a floating effect.
```html
diff --git a/snippets/focus-within.md b/snippets/focus-within.md
index 2cb60e785..42dead83b 100644
--- a/snippets/focus-within.md
+++ b/snippets/focus-within.md
@@ -5,7 +5,7 @@ tags: visual,interactivity,intermediate
Changes the appearance of a form if any of its children are focused.
-- 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.
+- Use the pseudo-class `:focus-within` to apply styles to a parent element if any child element gets focused.
```html