From d46cd95ad8c1b00f738a02c0f8e2b85622bb208c Mon Sep 17 00:00:00 2001 From: Jeremy Thomas Date: Sun, 19 Sep 2021 01:38:25 +0100 Subject: [PATCH] More mixin docs --- docs/_sass/examples/mixins.scss | 13 +++++ docs/css/bulma-docs.css | 28 ++++++++++ docs/documentation/utilities/mixins.html | 71 +++++++++++++++++++++++- 3 files changed, 109 insertions(+), 3 deletions(-) diff --git a/docs/_sass/examples/mixins.scss b/docs/_sass/examples/mixins.scss index 05fd78e8..a328582e 100644 --- a/docs/_sass/examples/mixins.scss +++ b/docs/_sass/examples/mixins.scss @@ -9,3 +9,16 @@ .bulma-delete-mixin { @include delete; } + +.bulma-loader-mixin { + @include loader; +} + +.bulma-block-mixin { + @include block(1rem); +} + +.bulma-fa-mixin { + @include fa(1rem, 2rem); + background-color: lavender; +} diff --git a/docs/css/bulma-docs.css b/docs/css/bulma-docs.css index 7a50bd31..240a8390 100644 --- a/docs/css/bulma-docs.css +++ b/docs/css/bulma-docs.css @@ -22362,3 +22362,31 @@ a.has-text-bootstrap-dark:hover, a.has-text-bootstrap-dark:focus { min-width: 32px; width: 32px; } + +.bulma-loader-mixin { + animation: spinAround 500ms infinite linear; + border: 2px solid #dbdbdb; + border-radius: 9999px; + border-right-color: transparent; + border-top-color: transparent; + content: ""; + display: block; + height: 1em; + position: relative; + width: 1em; +} + +.bulma-block-mixin:not(:last-child) { + margin-bottom: 1rem; +} + +.bulma-fa-mixin { + display: inline-block; + font-size: 1rem; + height: 2rem; + line-height: 2rem; + text-align: center; + vertical-align: top; + width: 2rem; + background-color: lavender; +} diff --git a/docs/documentation/utilities/mixins.html b/docs/documentation/utilities/mixins.html index 1829cf0b..cecb47b7 100644 --- a/docs/documentation/utilities/mixins.html +++ b/docs/documentation/utilities/mixins.html @@ -85,11 +85,76 @@ breadcrumb: -@include loader +

Loader

-@include fa($size, $dimensions) +
+

+ The loader() mixin creates a 1em spinning circle. +

+
-@include block($spacing: $block-spacing) +{% highlight sass %}.bulma-loader-mixin { + @include loader; +}{% endhighlight %} + +{% capture loader %} + +{% endcapture %} + +{% include elements/snippet.html content=loader %} + + + +

Block

+ +
+

+ The block() mixin adds spacing below an element, but only if it's not the last child. +
+ The $spacing parameter defines the value of the margin-bottom. +

+
+ +{% highlight sass %}.bulma-block-mixin { + @include block(1rem); +}{% endhighlight %} + +{% capture block %} +

This element has a margin-bottom.

+

This element too.

+

Not this one because it's the last child.

+{% endcapture %} + +{% include elements/snippet.html content=block %} + + + +

Font Awesome container

+ +
+

+ The fa() mixin creates a square inline-block element, ideal for containing a Font Awesome icon, or any other type of icon font. +
+ The first $size parameter defines the icon font size. +
+ The second $dimensions parameter defines the dimensions of the square container. +

+
+ +{% highlight sass %}.bulma-fa-mixin { + @include fa(1rem, 2rem); + background-color: lavender; // For demo purposes +}{% endhighlight %} + +{% capture fa %} + + + +{% endcapture %} + +{% include elements/snippet.html content=fa %} + + @include overlay($offset: 0)