Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(mdc): fix {attribute} examples #2228

Merged
merged 5 commits into from
Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 13 additions & 11 deletions docs/content/3.guide/1.writing/3.mdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,44 +308,46 @@ To create inline spans in your text you can use the `[]` identifier.

::code-group
```md [Code]
Hello [World]{.bg-blue-500}!
Hello [World]{style="background-color: var(--color-primary-500)"}!
```

::code-block{label="Preview"}
Hello [World]{.bg-primary-500}!
Hello [World]{style="background-color: var(--color-primary-500)"}!
::
::

## Attributes

Attributes are useful for highlighting and modifying part of paragraph. The syntax is nearly similar to inline components and markdown links syntax.

Possible values ​​are all named attributes, classes with the notation `.class-name` and an ID with `#id-name`.

::code-group
```md [Code]
Hello [World]{.text-primary-500}!
Hello [World]{style="color: var(--color-primary-500)" .custom-class #custom-id}!
```

::code-block{label="Preview"}
Hello [World]{.text-primary-500}!
Hello [World]{style="color: var(--color-primary-500)" .custom-class #custom-id}!
::
::

Other than `spans` the attribute syntax will work on images, links, `code`, **bold** and _italic_ texts.
In addition to mdc components and `spans`, attribute syntax will work on images, links, inline `code`, **bold** and _italic_ text.

::code-group
```md [Code]
Attributes works on:
Attributes work on:

- ![](/icon.png){.inline.m-0.bg-primary-800} image,
- [link](#attributes){.bg-primary-400}, `code`{.text-red-500},
- _italic_{.bg-primary-500} and **bold**{.bg-primary-500} texts.
- ![](/favicon.ico){style="display: inline; margin: 0; background-color: var(--color-primary-800);"} image,
- [link](#attributes){style="background-color: var(--color-primary-400);"}, `code`{style="color: var(--color-primary-500);"},
- _italic_{style="background-color: var(--color-primary-500);"} and **bold**{style="background-color: var(--color-primary-500);"} texts.
```

::code-block{label="Preview"}
Attributes works on:
Attributes work on:

- ![](/favicon.ico){style="display: inline; margin: 0; background-color: var(--color-primary-800);"} image,
- [link](#attributes){style="background-color: var(--color-primary-400);"}, `code`{style="color: var(--color-red-500);"},
- [link](#attributes){style="background-color: var(--color-primary-400);"}, `code`{style="color: var(--color-primary-500);"},
- _italic_{style="background-color: var(--color-primary-500);"} and **bold**{style="background-color: var(--color-primary-500);"} texts.
::
::