twbs/bootstrap

Reusable Sass utilities API documentation section

Open

#38 434 ouverte le 10 avr. 2023

Voir sur GitHub
 (3 commentaires) (0 réactions) (0 assignés)MDX (78 904 forks)batch import
docsenhancementhelp wanted

Métriques du dépôt

Stars
 (174 240 stars)
Métriques de merge PR
 (Merge moyen 4j 15h) (99 PRs mergées en 30 j)

Description

Enhancement suggested in https://github.com/twbs/bootstrap/pull/38219#discussion_r1148250058.

Our "Sass utilities API" sections are always written the same way.

We would need a shortcode or partial or anything else with two params:

  • First part of the sentence (e.g. "Background" or "Object fit")
  • The param (the key) used for scss-docs (e.g. "utils-bg-color")

We would like to call it like this:

{{< sass-utilities-api-section "Background" "utils-bg-color" >}}

And it would contain something like:

### Sass utilities API

{{ firstParam }} utilities are declared in our utilities API in `scss/_utilities.scss`. [Learn how to use the utilities API.]({{< docsref "/utilities/api#using-the-api" >}})

{{< scss-docs name="{{ secondParam }}" file="scss/_utilities.scss" >}}

We would need some help to do it. On my side, I don't exactly how to build it with Hugo. I tried a few things but haven't managed to succeed by calling scss-docs and docsref within another shortcode or from a partial.

Guide contributeur