]> git.ipfire.org Git - thirdparty/bulma.git/commitdiff
Add lots of snippets
authorJeremy Thomas <bbxdesign@gmail.com>
Wed, 30 Aug 2017 20:33:49 +0000 (21:33 +0100)
committerJeremy Thomas <bbxdesign@gmail.com>
Fri, 1 Sep 2017 08:16:16 +0000 (10:16 +0200)
docs/_includes/snippet.html
docs/_includes/subnav-components.html
docs/_sass/example.sass
docs/css/bulma-docs.css
docs/documentation/components/dropdown.html
docs/documentation/components/menu.html
docs/documentation/components/message.html
docs/documentation/components/pagination.html
docs/documentation/components/panel.html
docs/documentation/components/tabs.html
docs/documentation/elements/content.html

index 57e4c925d93f1504da3c1e18f8c891a87bffc42d..d1ddce0865822ae850ed64a4239c92e073c10c5b 100644 (file)
@@ -1,8 +1,12 @@
-<div class="bd-snippet">
+<div class="
+  bd-snippet
+  {% if include.horizontal %}bd-is-horizontal{% else %}bd-is-vertical{% endif %}
+  {% if include.size %}bd-is-{{ include.size }}{% endif %}
+  ">
   <div class="bd-snippet-preview">
     {{ include.content }}
   </div>
-  <div class="bd-snippet-code {%unless include.clipped %}highlight-full{% endunless %}">
+  <div class="bd-snippet-code {% unless include.clipped %}highlight-full{% endunless %}">
     {% highlight html %}{{ include.content }}{% endhighlight %}
   </div>
 </div>
index 1a312c2081b8468de96647641e0b4eb57f9581a1..738fb0689c0ea1d7595742bb3bc433a60e2f2a3f 100644 (file)
@@ -1,21 +1,14 @@
 <nav class="navbar has-shadow">
-  <div class="container is-fullhd">
+  <div class="container">
     <div class="navbar-brand">
-      {% if site.vernum >= 43 %}
-        <a class="navbar-item is-tab {% if page.doc-subtab == 'breadcrumb' %}is-active{% endif %}" href="{{ site.url }}/documentation/components/breadcrumb/">
-          Breadcrumb
-        </a>
-      {% endif %}
+      <a class="navbar-item is-tab {% if page.doc-subtab == 'breadcrumb' %}is-active{% endif %}" href="{{ site.url }}/documentation/components/breadcrumb/">
+        Breadcrumb
+      </a>
       <a class="navbar-item is-tab {% if page.doc-subtab == 'card' %}is-active{% endif %}" href="{{ site.url }}/documentation/components/card/">
         Card
       </a>
-      {% if site.vernum >= 44 %}
-        <a class="navbar-item is-tab {% if page.doc-subtab == 'dropdown' %}is-active{% endif %}" href="{{ site.url }}/documentation/components/dropdown/">
-          Dropdown
-        </a>
-      {% endif %}
-      <a class="navbar-item is-tab {% if page.doc-subtab == 'media-object' %}is-active{% endif %}" href="{{ site.url }}/documentation/components/media-object/">
-        Media object
+      <a class="navbar-item is-tab {% if page.doc-subtab == 'dropdown' %}is-active{% endif %}" href="{{ site.url }}/documentation/components/dropdown/">
+        Dropdown
       </a>
       <a class="navbar-item is-tab {% if page.doc-subtab == 'menu' %}is-active{% endif %}" href="{{ site.url }}/documentation/components/menu/">
         Menu
       <a class="navbar-item is-tab {% if page.doc-subtab == 'modal' %}is-active{% endif %}" href="{{ site.url }}/documentation/components/modal/">
         Modal
       </a>
-      {% if site.vernum >= 43 %}
-        <a class="navbar-item is-tab {% if page.doc-subtab == 'navbar' %}is-active{% endif %}" href="{{ site.url }}/documentation/components/navbar/">
-          Navbar
-        </a>
-      {% else %}
-        <a class="navbar-item is-tab {% if page.doc-subtab == 'nav' %}is-active{% endif %}" href="{{ site.url }}/documentation/components/nav/">
-          Nav
-        </a>
-      {% endif %}
+      <a class="navbar-item is-tab {% if page.doc-subtab == 'navbar' %}is-active{% endif %}" href="{{ site.url }}/documentation/components/navbar/">
+        Navbar
+      </a>
       <a class="navbar-item is-tab {% if page.doc-subtab == 'pagination' %}is-active{% endif %}" href="{{ site.url }}/documentation/components/pagination/">
         Pagination
       </a>
index da07adaea57b33f2f2b4664a2dd230270a7f5b0f..b685d24d20ab937122ae6d806279e12813369c84 100644 (file)
   position: relative
   &::before
     content: "Snippet"
-  +tablet
     align-items: stretch
     display: flex
 
-.bd-snippet-preview,
-.bd-snippet-code
-  +tablet
-    width: 50%
-
 .bd-snippet-preview
   padding: 1.5rem
 
 .bd-snippet-code
   background-color: $pre-background
-  +tablet
-    &,
-    .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
+
++desktop
+  .bd-snippet.bd-is-vertical
+    align-items: stretch
+    display: flex
+    justify-content: center
+    .bd-snippet-preview,
+    .bd-snippet-code
+      width: 50%
+    .bd-snippet-code
+      &,
+      .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
+    &.bd-is-one-third
+      .bd-snippet-preview
+        width: 33.3333%
+      .bd-snippet-code
+        width: 66.6666%
 
 // Highlight
 .highlight.bd-is-hovering
@@ -83,7 +91,7 @@
   box-shadow: 0 0 0 2px $yellow
 
 .highlight pre
-  max-height: 480px
+  max-height: 320px
   margin-bottom: 0 !important
   padding: 0
   code
index c595114bf9c19767b5157bab49aedf614a3ed4b6..a06174019185a71bd1f4fe8b78b92ede704c3b64 100644 (file)
@@ -9622,20 +9622,8 @@ html.route-index #carbon {
 
 .bd-snippet::before {
   content: "Snippet";
-}
-
-@media screen and (min-width: 769px), print {
-  .bd-snippet {
-    align-items: stretch;
-    display: flex;
-  }
-}
-
-@media screen and (min-width: 769px), print {
-  .bd-snippet-preview,
-  .bd-snippet-code {
-    width: 50%;
-  }
+  align-items: stretch;
+  display: flex;
 }
 
 .bd-snippet-preview {
@@ -9646,22 +9634,37 @@ html.route-index #carbon {
   background-color: whitesmoke;
 }
 
-@media screen and (min-width: 769px), print {
-  .bd-snippet-code,
-  .bd-snippet-code .highlight,
-  .bd-snippet-code .highlight pre {
+@media screen and (min-width: 1008px) {
+  .bd-snippet.bd-is-vertical {
+    align-items: stretch;
+    display: flex;
+    justify-content: center;
+  }
+  .bd-snippet.bd-is-vertical .bd-snippet-preview,
+  .bd-snippet.bd-is-vertical .bd-snippet-code {
+    width: 50%;
+  }
+  .bd-snippet.bd-is-vertical .bd-snippet-code,
+  .bd-snippet.bd-is-vertical .bd-snippet-code .highlight,
+  .bd-snippet.bd-is-vertical .bd-snippet-code .highlight pre {
     align-items: stretch;
     display: flex;
     flex-direction: column;
   }
-  .bd-snippet-code .highlight,
-  .bd-snippet-code .highlight pre,
-  .bd-snippet-code .highlight .language-html {
+  .bd-snippet.bd-is-vertical .bd-snippet-code .highlight,
+  .bd-snippet.bd-is-vertical .bd-snippet-code .highlight pre,
+  .bd-snippet.bd-is-vertical .bd-snippet-code .highlight .language-html {
     flex-grow: 1;
   }
-  .bd-snippet-code .highlight pre {
+  .bd-snippet.bd-is-vertical .bd-snippet-code .highlight pre {
     white-space: pre;
   }
+  .bd-snippet.bd-is-vertical.bd-is-one-third .bd-snippet-preview {
+    width: 33.3333%;
+  }
+  .bd-snippet.bd-is-vertical.bd-is-one-third .bd-snippet-code {
+    width: 66.6666%;
+  }
 }
 
 .highlight.bd-is-hovering {
@@ -9670,7 +9673,7 @@ html.route-index #carbon {
 }
 
 .highlight pre {
-  max-height: 480px;
+  max-height: 320px;
   margin-bottom: 0 !important;
   padding: 0;
 }
index 03f3485bde8926536e441c70aef6e57283024a47..0bea49ae5ea6467d4be49c97547b092eae8f2342 100644 (file)
@@ -253,11 +253,7 @@ variables:
       </div>
     </div>
 
-    <hr>
-
-    <h3 class="title">
-      Dropdown content
-    </h3>
+    {% include anchor.html name="Dropdown content" %}
 
     <div class="content">
       <p>
@@ -274,11 +270,7 @@ variables:
       </div>
     </div>
 
-    <hr>
-
-    <h3 class="title">
-      Hoverable or Toggable
-    </h3>
+    {% include anchor.html name="Hoverable or Toggable" %}
 
     <div class="content">
       <p>
@@ -309,11 +301,7 @@ variables:
       </div>
     </div>
 
-    <hr>
-
-    <h3 class="title">
-      Right aligned
-    </h3>
+    {% include anchor.html name="Right aligned" %}
 
     <div class="content">
       <p>
index 2a889a89ba87e514561a79ae8714bacd2df7aefc..bc9cf4081aa34d9a1e569edda9db275bc5a11de1 100644 (file)
@@ -73,14 +73,7 @@ variables:
 
     <hr>
 
-    <div class="columns">
-      <div class="column is-3">
-        {{menu_example}}
-      </div>
-      <div class="column highlight-full">
-        {% highlight html %}{{menu_example}}{% endhighlight %}
-      </div>
-    </div>
+    {% include snippet.html content=menu_example size="one-third" %}
 
     {% include variables.html %}
 
index 1692547be607f357614c078504105b6802d0e590..bc5988c44f5129310ee465dd840df3f2775e4ee9 100644 (file)
@@ -201,78 +201,29 @@ variables:
 
     <hr>
 
-    <div class="columns">
-      <div class="column is-half">
-        {{message_example}}
-      </div>
-      <div class="column is-half">
-        {% highlight html %}{{message_example}}{% endhighlight %}
-      </div>
-    </div>
+    {% include snippet.html content=message_example %}
 
     {% include anchor.html name="Colors" %}
 
-    <div class="columns">
-      <div class="column is-half">
-        {{message_colors_example}}
-      </div>
-      <div class="column is-half">
-        {% highlight html %}{{message_colors_example}}{% endhighlight %}
-      </div>
-    </div>
+    {% include snippet.html content=message_colors_example %}
 
-    <hr>
+    {% include anchor.html name="Message body only" %}
 
-    <h3 class="title">Message body only</h3>
     <div class="content">
       <p>You can <strong>omit</strong> the message header:</p>
     </div>
-    <div class="columns">
-      <div class="column is-half">
-        {{message_body_example}}
-      </div>
-      <div class="column is-half">
-        {% highlight html %}{{message_body_example}}{% endhighlight %}
-      </div>
-    </div>
+
+    {% include snippet.html content=message_body_example %}
 
     {% include anchor.html name="Sizes" %}
 
-    <div class="columns">
-      <div class="column is-half">
-        {{message_small}}
-      </div>
-      <div class="column is-half">
-        {% highlight html %}{{message_small}}{% endhighlight %}
-      </div>
-    </div>
+    {% include snippet.html content=message_small %}
 
-    <div class="columns">
-      <div class="column is-half">
-        {{message_normal}}
-      </div>
-      <div class="column is-half">
-        {% highlight html %}{{message_normal}}{% endhighlight %}
-      </div>
-    </div>
+    {% include snippet.html content=message_normal %}
 
-    <div class="columns">
-      <div class="column is-half">
-        {{message_medium}}
-      </div>
-      <div class="column is-half">
-        {% highlight html %}{{message_medium}}{% endhighlight %}
-      </div>
-    </div>
+    {% include snippet.html content=message_medium %}
 
-    <div class="columns">
-      <div class="column is-half">
-        {{message_large}}
-      </div>
-      <div class="column is-half">
-        {% highlight html %}{{message_large}}{% endhighlight %}
-      </div>
-    </div>
+    {% include snippet.html content=message_large %}
 
     {% include variables.html %}
 
index 4b926620c15ac44103a7c2f26db72a2020b349cc..b55f67daf9feeaee38da787d10f663e6b8edda64 100644 (file)
@@ -245,11 +245,7 @@ variables:
 
     {% highlight html %}{{pagination_right_example}}{% endhighlight %}
 
-    <hr style="margin-bottom: 0;">
-
-    <h2 id="sizes" class="title" style="padding-top: 1.5rem;">
-      Sizes
-    </h2>
+    {% include anchor.html name="Sizes" %}
 
     <p class="content">
       The pagination comes in <strong>3 additional sizes</strong>.<br>
index 4d9dda752556ec0b9b91a96681b68106511bdb2d..f3dd085aafe9c752428e90f8b41e7d6849a95c04 100644 (file)
@@ -152,14 +152,7 @@ variables:
       </p>
     </div>
 
-    <div class="columns">
-      <div class="column is-4">
-        {{panel_example}}
-      </div>
-      <div class="column">
-        {% highlight html %}{{panel_example}}{% endhighlight %}
-      </div>
-    </div>
+    {% include snippet.html content=panel_example size="one-third" %}
 
     {% include variables.html %}
 
index dd387ee43cd7d13de4ca5da153b50a178308628b..9587ba4254b7c113eb57d1eb8c1306b9822a4563 100644 (file)
@@ -382,118 +382,76 @@ variables:
         The <strong>default</strong> tabs style has a single border at the bottom.</p>
     </div>
 
-    <div class="bd-example">
-      {{tabs_example}}
-    </div>
-    {% highlight html %}{{tabs_example}}{% endhighlight %}
+    {% include snippet.html content=tabs_example horizontal=true %}
 
-    <hr>
+    {% include snippet.html content=tabs_example horizontal=true clipped=true %}
+
+    {% include anchor.html name="Alignment" %}
 
-    <h3 class="title">Alignment</h3>
     <div class="content">
       <p>
         To align the tabs list, use the <code>is-centered</code> or <code>is-right</code> modifier on the <code>.tabs</code> container:
       </p>
     </div>
 
-    <div class="bd-example">
-      {{tabs_centered_example}}
-    </div>
-    {% highlight html %}{{tabs_centered_example}}{% endhighlight %}
+    {% include snippet.html content=tabs_centered_example horizontal=true clipped=true %}
 
-    <div class="bd-example">
-      {{tabs_right_example}}
-    </div>
-    {% highlight html %}{{tabs_right_example}}{% endhighlight %}
+    {% include snippet.html content=tabs_right_example horizontal=true clipped=true %}
 
-    <hr>
+    {% include anchor.html name="Icons" %}
 
-    <h3 class="title">Icons</h3>
     <div class="content">
       <p>You can use any of the <a href="http://fortawesome.github.io/Font-Awesome/">Font Awesome</a> <strong>icons</strong>.</p>
     </div>
 
-    <div class="bd-example">
-      {{tabs_icons_example}}
-    </div>
-    {% highlight html %}{{tabs_icons_example}}{% endhighlight %}
+    {% include snippet.html content=tabs_icons_example horizontal=true clipped=true %}
+
+    {% include snippet.html content=tabs_icons_example horizontal=true clipped=true %}
 
     {% include anchor.html name="Sizes" %}
     <div class="content">
       <p>You can choose between <strong>3 additional sizes</strong>: <code>is-small</code> <code>is-medium</code> and <code>is-large</code>.</p>
     </div>
 
-    <div class="bd-example">
-      {{tabs_small_example}}
-    </div>
-    {% highlight html %}{{tabs_small_example}}{% endhighlight %}
+    {% include snippet.html content=tabs_small_example horizontal=true clipped=true %}
 
-    <div class="bd-example">
-      {{tabs_medium_example}}
-    </div>
-    {% highlight html %}{{tabs_medium_example}}{% endhighlight %}
+    {% include snippet.html content=tabs_medium_example horizontal=true clipped=true %}
 
-    <div class="bd-example">
-      {{tabs_large_example}}
-    </div>
-    {% highlight html %}{{tabs_large_example}}{% endhighlight %}
+    {% include snippet.html content=tabs_large_example horizontal=true clipped=true %}
 
-    <hr>
+    {% include anchor.html name="Styles" %}
 
-    <h3 class="title">Styles</h3>
     <div class="content">
       If you want a more classic style with <strong>borders</strong>, just append the <code>is-boxed</code> modifier.
     </div>
 
-    <div class="bd-example">
-      {{tabs_boxed_example}}
-    </div>
-    {% highlight html %}{{tabs_boxed_example}}{% endhighlight %}
+    {% include snippet.html content=tabs_boxed_example horizontal=true clipped=true %}
 
     <p class="content">
       If you want <strong>mutually exclusive</strong> tabs (like radio buttons where clicking one deselects all other ones), use the <code>is-toggle</code> modifier.
     </p>
 
-    <div class="bd-example">
-      {{tabs_toggle_example}}
-    </div>
-    {% highlight html %}{{tabs_toggle_example}}{% endhighlight %}
+    {% include snippet.html content=tabs_toggle_example horizontal=true clipped=true %}
 
     <p class="content">
       If you want the tabs to take up the <strong>whole width</strong> available, use <code>is-fullwidth</code>.
     </p>
 
-    <div class="bd-example">
-      {{tabs_fullwidth_example}}
-    </div>
-    {% highlight html %}{{tabs_fullwidth_example}}{% endhighlight %}
+    {% include snippet.html content=tabs_fullwidth_example horizontal=true clipped=true %}
 
-    <hr>
+    {% include anchor.html name="Combining" %}
 
-    <h3 class="title">Combining</h3>
     <div class="content">
       <p>You can <strong>combine</strong> different modifiers. For example, you can have <strong>centered boxed</strong> tabs, or <strong>fullwidth toggle</strong> ones.</p>
     </div>
 
-    <div class="bd-example">
-      {{tabs_centered_boxed_example}}
-    </div>
-    {% highlight html %}{{tabs_centered_boxed_example}}{% endhighlight %}
+    {% include snippet.html content=tabs_centered_boxed_example horizontal=true clipped=true %}
 
-    <div class="bd-example">
-      {{tabs_toggle_fullwidth_example}}
-    </div>
-    {% highlight html %}{{tabs_toggle_fullwidth_example}}{% endhighlight %}
+    {% include snippet.html content=tabs_toggle_fullwidth_example horizontal=true clipped=true %}
 
-    <div class="bd-example">
-      {{tabs_centered_boxed_medium_example}}
-    </div>
-    {% highlight html %}{{tabs_centered_boxed_medium_example}}{% endhighlight %}
+    {% include snippet.html content=tabs_centered_boxed_medium_example horizontal=true clipped=true %}
 
-    <div class="bd-example">
-      {{tabs_toggle_fullwidth_large_example}}
-    </div>
-    {% highlight html %}{{tabs_toggle_fullwidth_large_example}}{% endhighlight %}
+    {% include snippet.html content=tabs_toggle_fullwidth_large_example horizontal=true clipped=true %}
 
     {% include variables.html %}
 
index cee752fd81f48b00987ce267c5465404a2ba3c82..cbefba252db8956b9d997a245f11680603741e3f 100644 (file)
@@ -164,7 +164,7 @@ variables:
       <p>This <code>content</code> class can be used in <em>any</em> context where you just want to (or can only) write some <strong>text</strong>. For example, it's used for the paragraph you're currently reading.</p>
     </div>
 
-    {% include snippet.html content=content_example fullheight=true %}
+    {% include snippet.html content=content_example %}
 
     {% include anchor.html name="Sizes" %}