Skip to content

Commit

Permalink
Improve SEO of background patterns story
Browse files Browse the repository at this point in the history
Add titles for each pattern, then use CSS to hide the
default code block annotation and place the title in
place of the annotation, allowing it to be linkable and
discoverable by search engines.
  • Loading branch information
Chalarangelo committed May 9, 2024
1 parent 4d5459f commit a6e13e3
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion content/snippets/css/s/10-css-background-patterns.md
Expand Up @@ -17,14 +17,32 @@ dateModified: 2024-05-09
width: 100%;
height: 144px;
border-radius: var(--layout-border-radius) var(--layout-border-radius) 0 0;
margin-top: var(--layout-row-spacing);
}

.pattern-box + pre {
margin-block-start: calc(-1 * var(--layout-row-spacing, 0));
border-radius: 0 0 var(--layout-border-radius) var(--layout-border-radius);
}

.pattern-box + pre::before {
opacity: 0;
}

main > article > h2 {
margin: 0;
font-size: var(--font-sm);
transform: translateY(186px);
z-index: 1;
height: 0;
}

main > article > h2::after {
display: inline-block;
font-size: var(--font-sm);
content: "(CSS)";
margin-inline-start: var(--spacing-2);
}

.lines-2 {
background-color: #fefefe;
background-image: linear-gradient(to right, #5394fd, #5394fd 12px, #fefefe 12px, #fefefe );
Expand Down Expand Up @@ -91,6 +109,8 @@ dateModified: 2024-05-09
}
</style>

## Stripes pattern

<div class="pattern-box lines-2"></div>

```css
Expand All @@ -107,6 +127,8 @@ dateModified: 2024-05-09
}
```

## Zig zag pattern

<div class="pattern-box zigzag"></div>

```css
Expand All @@ -126,6 +148,8 @@ dateModified: 2024-05-09
}
```

## Polka dot pattern

<div class="pattern-box polka"></div>

```css
Expand All @@ -136,6 +160,8 @@ dateModified: 2024-05-09
}
```

## Checkerboard pattern

<div class="pattern-box rectangles"></div>

```css
Expand Down Expand Up @@ -164,6 +190,8 @@ dateModified: 2024-05-09
}
```

## Rhombus pattern

<div class="pattern-box rhombus"></div>

```css
Expand All @@ -183,6 +211,8 @@ dateModified: 2024-05-09
}
```

## Paper pattern

<div class="pattern-box paper"></div>

```css
Expand All @@ -205,6 +235,8 @@ dateModified: 2024-05-09
}
```

## Diagonal pattern

<div class="pattern-box diagonal"></div>

```css
Expand All @@ -220,6 +252,8 @@ dateModified: 2024-05-09
}
```

## Triangles pattern

<div class="pattern-box triangle"></div>

```css
Expand All @@ -230,6 +264,8 @@ dateModified: 2024-05-09
}
```

## Waves pattern

<div class="pattern-box wavy"></div>

```css
Expand All @@ -244,6 +280,8 @@ dateModified: 2024-05-09
}
```

## Isometric pattern

<div class="pattern-box isometric"></div>

```css
Expand Down

0 comments on commit a6e13e3

Please sign in to comment.