twbs/bootstrap

Reusable Sass utilities API documentation section

Open

#38.434 aperta il 10 apr 2023

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)MDX (78.904 fork)batch import
docsenhancementhelp wanted

Metriche repository

Star
 (174.240 star)
Metriche merge PR
 (Merge medio 6g 11h) (47 PR mergiate in 30 g)

Descrizione

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.

Guida contributor