Skip to content

Commit

Permalink
Add "steps" list CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
facelessuser committed Jan 7, 2025
1 parent 5c38bfc commit e823ada
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 31 deletions.
11 changes: 8 additions & 3 deletions docs/src/markdown/extensions/magiclink.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,19 +453,24 @@ control over specifics, so if this is sufficient for your needs, then it give it

To specify a custom provider, you simply need to specify them via the `custom` option.

/// html | div.steps
1. Simply specify the name to identify the provider (must only contain alphanumeric characters). Provider name is used
when manually specifying a provider (`@provider:user`) and will be used to generate custom CSS classes
`magiclink-provider`.

2. Specify the `type`. Is this a private `github`, `gitlab`, or `bitbucket` provider.
3. Specify the `label` for tooltips.
4. Specify the `host` for your private repository.

3. Specify the `host` for your private repository.

4. Specify the `label` for tooltips.
///

```js
'custom': {
'test': {
'type': 'github',
'host': 'http://test.com',
'label': 'Test',
'type': 'github'
}
}
```
Expand Down
43 changes: 43 additions & 0 deletions docs/src/scss/extensions/_steps.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@use "../utilities/convert";

.md-typeset div.steps > ol {
counter-reset: item;

li {
position: relative;
padding-left: 1em;
list-style: none;

&::before {
position: absolute;
top: 0;
left: 0;
z-index: -1;
display: block;
width: 1.75em;
height: 1.75em;
margin-left: -1.25em;
color: var(--md-steps-fg-color);
font-weight: 600;
font-size: 0.9em;
text-align: center;
background-color: var(--md-steps-bg-color);
border: 1px solid var(--md-steps-border-color);
border-radius: 100px;
content: counter(item);
counter-increment: item;
}

&::after {
position: absolute;
top: 0;
bottom: 0;
left: -0.36em;
display: block;
width: 1px;
margin-top: 2em;
border-left: 1px solid var(--md-steps-border-color);
content: '';
}
}
}
1 change: 1 addition & 0 deletions docs/src/scss/extra.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
@use "extensions/tasklist";
@use "extensions/toc";
@use "extensions/superfences";
@use "extensions/steps";

@use "material";
11 changes: 11 additions & 0 deletions docs/src/scss/palette/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
--md-code-hl-builtin-color: var(--md-code-hl-constant-color);
--md-code-hl-class-color: var(--md-code-hl-function-color);

// List steps
--md-steps-bg-color: var(--md-code-bg-color);
--md-steps-fg-color: var(--md-code-fg-color);
--md-steps-border-color: hsla(0, 0%, 75%, 1);

// Various Material related color variables
--md-typeset-a-color: #{material_color.$clr-cyan-500};

Expand All @@ -48,6 +53,9 @@
--md-code-special-bg-color: #{color.adjust(hsl(232, 15%, 15%), $lightness: 5%)};
--md-default-bg-color--trans: hsla(232,15%,15%, 0);

// List steps
--md-steps-border-color: hsla(225, 15%, 30%, 1);

// Keys colors
--md-typeset-kbd-color: var(--md-default-fg-color--lightest);
--md-typeset-kbd-border-color: #{color.adjust(rgb(46, 48, 62), $lightness: -9%)};
Expand Down Expand Up @@ -114,6 +122,9 @@
--md-code-alternate-bg-color: #{color_tools.tint(dracula.$drac-bg, 10%)};
--md-code-link-bg-color: #{color.mix(dracula.$drac-cyan, dracula.$drac-bg, 15%)};

// List steps
--md-steps-border-color: #{color.adjust(dracula.$drac-bg, $lightness: 10%)};

// Various Material related color variables
--md-typeset-a-color: #{dracula.$drac-cyan};
--md-typeset-mark-color: #{color.mix(dracula.$drac-yellow, dracula.$drac-bg, 35%)};
Expand Down
2 changes: 2 additions & 0 deletions docs/theme/assets/pymdownx-extras/extra-3005714f37.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/theme/assets/pymdownx-extras/extra-3005714f37.css.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions docs/theme/assets/pymdownx-extras/extra-add764b01e.css

This file was deleted.

1 change: 0 additions & 1 deletion docs/theme/assets/pymdownx-extras/extra-add764b01e.css.map

This file was deleted.

2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ extra:
link: /~https://github.com/facelessuser
extra_css:
# - https://cdn.jsdelivr.net/npm/katex@0.13.18/dist/katex.min.css
- assets/pymdownx-extras/extra-add764b01e.css
- assets/pymdownx-extras/extra-3005714f37.css
extra_javascript:
- https://cdn.jsdelivr.net/npm/mermaid@11.3.0/dist/mermaid.min.js
# - https://cdn.jsdelivr.net/npm/katex@0.13.18/dist/katex.min.js
Expand Down
36 changes: 12 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e823ada

Please sign in to comment.