Skip to content

Commit

Permalink
feat: callout styles
Browse files Browse the repository at this point in the history
  • Loading branch information
EATSTEAK committed Aug 19, 2024
1 parent fab2a98 commit 4e97572
Show file tree
Hide file tree
Showing 2 changed files with 213 additions and 26 deletions.
129 changes: 106 additions & 23 deletions src/content/blog/markdown-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Here is a sample of some basic Markdown syntax that can be used when writing Mar

## Headings

The following HTML `<h1>``<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest.
The following HTML `<h1>``<h6>` elements represent six levels of section headings. `<h1>` is the highest section level
while `<h6>` is the lowest.

## H2

Expand All @@ -24,9 +25,15 @@ The following HTML `<h1>`—`<h6>` elements represent six levels of section head

## Paragraph

Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.
Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut
dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna
tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem
aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos
nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores
editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.

Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.
Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que
aut hariosam ex eat.

## Images

Expand All @@ -42,7 +49,8 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap

## Blockquotes

The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations.
The blockquote element represents content that is quoted from another source, optionally with a citation which must be
within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations.

### Blockquote without attribution

Expand Down Expand Up @@ -72,7 +80,80 @@ The blockquote element represents content that is quoted from another source, op
> Don't communicate by sharing memory, share memory by communicating.<br>
> — <cite>Rob Pike[^1]</cite>
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during
Gopherfest, November 18, 2015.

## Callouts

### Note

#### Syntax

```markdown
> [!NOTE] Note
> Content
```

#### Output

> [!NOTE] Note
> Content
### Tip

#### Syntax

```markdown
> [!TIP] Tip
> Content
```

#### Output

> [!TIP] Tip
> Content
### Important

#### Syntax

```markdown
> [!IMPORTANT] Important
> Content
```

#### Output

> [!IMPORTANT] Important
> Content
### Warning

#### Syntax

```markdown
> [!WARNING] Warning
> Content
```

#### Output

> [!WARNING] Warning
> Content
### Caution

#### Syntax

```markdown
> [!CAUTION] Caution
> Content
```

#### Output

> [!CAUTION] Caution
> Content
## Tables

Expand All @@ -87,14 +168,16 @@ The blockquote element represents content that is quoted from another source, op
### Output

| Italics | Bold | Code |
| --------- | -------- | ------ |
|-----------|----------|--------|
| _italics_ | **bold** | `code` |

## Code Blocks

### Syntax

we can use 3 backticks ``` in new line and write snippet and close with 3 backticks on new line and to highlight language specific syntac, write one word of language name after first 3 backticks, for eg. html, javascript, css, markdown, typescript, txt, bash
we can use 3 backticks ``` in new line and write snippet and close with 3 backticks on new line and to highlight
language specific syntac, write one word of language name after first 3 backticks, for eg. html, javascript, css,
markdown, typescript, txt, bash

````markdown
```html
Expand All @@ -116,13 +199,13 @@ Output
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<head>
<meta charset="utf-8"/>
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</head>
<body>
<p>Test</p>
</body>
</html>
```

Expand Down Expand Up @@ -166,23 +249,23 @@ Output

```markdown
- Fruit
- Apple
- Orange
- Banana
- Apple
- Orange
- Banana
- Dairy
- Milk
- Cheese
- Milk
- Cheese
```

#### Output

- Fruit
- Apple
- Orange
- Banana
- Apple
- Orange
- Banana
- Dairy
- Milk
- Cheese
- Milk
- Cheese

## Other Elements — abbr, sub, sup, kbd, mark

Expand Down
110 changes: 107 additions & 3 deletions src/styles/prose.css
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,12 @@

.content [data-callout] {
border-left: 4px solid;
padding: 1rem 0.5rem 1rem 1.5rem;
padding: 1rem 0.5rem 0.5rem 1.5rem;
margin: .5em 0;

& [data-callout-title]::before {
margin: 0 0.25rem 0 0;
}
}

/* Note Callouts */
Expand All @@ -244,7 +248,6 @@

&::before {
content: "🖋️";
margin: 0 0.5rem 0 0;

:not(.dark) & {
@apply text-blue-600;
Expand Down Expand Up @@ -279,7 +282,6 @@

&::before {
content: "💡";
margin: 0 0.5rem 0 0;

:not(.dark) & {
@apply text-green-600;
Expand All @@ -291,3 +293,105 @@
}
}
}

.content [data-callout-type="important"] {
:not(.dark) & {
@apply border-l-purple-600 bg-purple-100;
}

.dark & {
@apply border-l-purple-400 bg-purple-950;
}

& [data-callout-title] {
@apply font-bold;

:not(.dark) & {
@apply text-purple-600;
}

.dark & {
@apply text-purple-300;
}

&::before {
content: "📌";

:not(.dark) & {
@apply text-purple-600;
}

.dark & {
@apply text-purple-300;
}
}
}
}

.content [data-callout-type="warning"] {
:not(.dark) & {
@apply border-l-yellow-600 bg-yellow-100;
}

.dark & {
@apply border-l-yellow-400 bg-yellow-950;
}

& [data-callout-title] {
@apply font-bold;

:not(.dark) & {
@apply text-yellow-600;
}

.dark & {
@apply text-yellow-300;
}

&::before {
content: "⚠️";

:not(.dark) & {
@apply text-yellow-600;
}

.dark & {
@apply text-yellow-300;
}
}
}
}

.content [data-callout-type="caution"] {
:not(.dark) & {
@apply border-l-red-600 bg-red-100;
}

.dark & {
@apply border-l-red-400 bg-red-950;
}

& [data-callout-title] {
@apply font-bold;

:not(.dark) & {
@apply text-red-600;
}

.dark & {
@apply text-red-300;
}

&::before {
content: "⛔";

:not(.dark) & {
@apply text-red-600;
}

.dark & {
@apply text-red-300;
}
}
}
}

0 comments on commit 4e97572

Please sign in to comment.