From: Jeremy Thomas Date: Wed, 30 Aug 2017 20:13:17 +0000 (+0100) Subject: Add more snippets X-Git-Tag: 0.5.2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08e082ae07fba91bd45557cfa7b46c02dbd661bf;p=thirdparty%2Fbulma.git Add more snippets --- diff --git a/docs/_includes/snippet.html b/docs/_includes/snippet.html index 16aeddef2..57e4c925d 100644 --- a/docs/_includes/snippet.html +++ b/docs/_includes/snippet.html @@ -2,7 +2,7 @@
{{ include.content }}
-
+
{% highlight html %}{{ include.content }}{% endhighlight %}
diff --git a/docs/_sass/example.sass b/docs/_sass/example.sass index dad351a5e..da07adaea 100644 --- a/docs/_sass/example.sass +++ b/docs/_sass/example.sass @@ -64,11 +64,18 @@ .bd-snippet-code background-color: $pre-background +tablet - align-items: stretch - display: flex - flex-direction: column - .highlight + &, + .highlight, + .highlight pre + align-items: stretch + display: flex + flex-direction: column + .highlight, + .highlight pre, + .highlight .language-html flex-grow: 1 + .highlight pre + white-space: pre // Highlight .highlight.bd-is-hovering diff --git a/docs/css/bulma-docs.css b/docs/css/bulma-docs.css index 31288afeb..c595114bf 100644 --- a/docs/css/bulma-docs.css +++ b/docs/css/bulma-docs.css @@ -9647,14 +9647,21 @@ html.route-index #carbon { } @media screen and (min-width: 769px), print { - .bd-snippet-code { + .bd-snippet-code, + .bd-snippet-code .highlight, + .bd-snippet-code .highlight pre { align-items: stretch; display: flex; flex-direction: column; } - .bd-snippet-code .highlight { + .bd-snippet-code .highlight, + .bd-snippet-code .highlight pre, + .bd-snippet-code .highlight .language-html { flex-grow: 1; } + .bd-snippet-code .highlight pre { + white-space: pre; + } } .highlight.bd-is-hovering { diff --git a/docs/documentation/elements/box.html b/docs/documentation/elements/box.html index a2f48422e..66c5d90d8 100644 --- a/docs/documentation/elements/box.html +++ b/docs/documentation/elements/box.html @@ -71,23 +71,15 @@ variables:
-
-
-
-

- The .box element is simply a container with a shadow, a border, a radius, and some padding. -
- For example, you can include a media object: -

-
-
- -
- {{box_example}} -
+
+

+ The .box element is simply a container with a shadow, a border, a radius, and some padding. +
+ For example, you can include a media object: +

- {% highlight html %}{{box_example}}{% endhighlight %} + {% include snippet.html content=box_example %} {% include variables.html %} diff --git a/docs/documentation/elements/content.html b/docs/documentation/elements/content.html index 21456eba8..cee752fd8 100644 --- a/docs/documentation/elements/content.html +++ b/docs/documentation/elements/content.html @@ -164,11 +164,7 @@ variables:

This content class can be used in any context where you just want to (or can only) write some text. For example, it's used for the paragraph you're currently reading.

-
- {{content_example}} -
- - {% highlight html %}{{content_example}}{% endhighlight %} + {% include snippet.html content=content_example fullheight=true %} {% include anchor.html name="Sizes" %} diff --git a/docs/documentation/elements/delete.html b/docs/documentation/elements/delete.html index c51223088..0a87f56a6 100644 --- a/docs/documentation/elements/delete.html +++ b/docs/documentation/elements/delete.html @@ -61,57 +61,32 @@ doc-subtab: delete

The .delete element is a stand-alone element that can be used in different contexts.

+

+ On its own, it's a simple circle with a cross: +

-
-
-
-

- On its own, it's a simple circle with a cross: -

-
- {{cross_example}} -
-
- {% highlight html %}{{cross_example}}{% endhighlight %} -
-
+ {% include snippet.html content=cross_example %} {% include anchor.html name="Sizes" %} -
-
-
-

- It comes in 4 sizes: -

-
- {{cross_sizes_example}} -
-
- {% highlight html %}{{cross_sizes_example}}{% endhighlight %} -
+
+

+ It comes in 4 sizes: +

-
- -

- Combinations -

- -
-
-
-

- Bulma uses it for the tags, the notifications, and the messages: -

-
- {{cross_elements_example}} -
-
- {% highlight html %}{{cross_elements_example}}{% endhighlight %} -
+ {% include snippet.html content=cross_sizes_example %} + + {% include anchor.html name="Combinations" %} + +
+

+ Bulma uses it for the tags, the notifications, and the messages: +

+ {% include snippet.html content=cross_elements_example %} +
diff --git a/docs/documentation/elements/icon.html b/docs/documentation/elements/icon.html index e3a76926b..b0a4fc54f 100644 --- a/docs/documentation/elements/icon.html +++ b/docs/documentation/elements/icon.html @@ -42,11 +42,7 @@ variables:

Because the icons can take a few seconds to load, and because you want control over the space the icons will take, you can use the icon class as a container:

-
- {{icon_example}} -
- - {% highlight html %}{{icon_example}}{% endhighlight %} + {% include snippet.html content=icon_example %}

The icon container will take up exactly 1.5rem x 1.5rem. The icon itself is sized at 21px.

diff --git a/docs/documentation/elements/image.html b/docs/documentation/elements/image.html index ce3fd1d95..9a08bfea2 100644 --- a/docs/documentation/elements/image.html +++ b/docs/documentation/elements/image.html @@ -49,17 +49,10 @@ variables:

Because images can take a few seconds to load (or not at all), use the .image container to specify a precisely sized container so that your layout isn't broken because of image loading or image errors.

-
-
- -
-
- - {% highlight html %}{{ image }}{% endhighlight %} + {% include snippet.html content=image %} -
+ {% include anchor.html name="Fixed square images" %} -

Fixed square images

There are 7 dimensions to choose from, useful for avatars:

@@ -76,23 +69,15 @@ variables: -

Retina images

+ {% include anchor.html name="Retina images" %}

Because the image is fixed in size, you can use an image that is twice as big. So for example, in a 128x128 container, you can use a 256x256 image, but resized to 128x128 pixels.

-
-
- -
-
- - {% highlight html %}{{ retina_image }}{% endhighlight %} - -
+ {% include snippet.html content=retina_image %} -

Responsive images with ratios

+ {% include anchor.html name="Responsive images with ratios" %}

If you don't know the exact dimensions but know the ratio instead, you can use one of the 5 ratio modifers:

diff --git a/docs/documentation/elements/notification.html b/docs/documentation/elements/notification.html index a23e56fd1..b491a9ead 100644 --- a/docs/documentation/elements/notification.html +++ b/docs/documentation/elements/notification.html @@ -75,25 +75,11 @@ variables:
-
-
- {{ notification }} -
-
- {% highlight html %}{{ notification }}{% endhighlight %} -
-
+ {% include snippet.html content=notification %} {% include anchor.html name="Colors" %} -
-
- {{ notification_colors }} -
-
- {% highlight html %}{{ notification_colors }}{% endhighlight %} -
-
+ {% include snippet.html content=notification_colors %} {% include variables.html %} diff --git a/docs/documentation/elements/progress.html b/docs/documentation/elements/progress.html index 7cc0a0b95..66e20faeb 100644 --- a/docs/documentation/elements/progress.html +++ b/docs/documentation/elements/progress.html @@ -46,24 +46,15 @@ variables:
-
- {{ progress }} -
- {% highlight html %}{{ progress }}{% endhighlight %} + {% include snippet.html content=progress %} {% include anchor.html name="Colors" %} -
- {{ progress_colors }} -
- {% highlight html %}{{ progress_colors }}{% endhighlight %} + {% include snippet.html content=progress_colors %} {% include anchor.html name="Sizes" %} -
- {{ progress_sizes }} -
- {% highlight html %}{{ progress_sizes }}{% endhighlight %} + {% include snippet.html content=progress_sizes %} {% include variables.html element=true %}