]> git.ipfire.org Git - thirdparty/bulma.git/commitdiff
Fix #1759
authorJeremy Thomas <bbxdesign@gmail.com>
Sun, 8 Apr 2018 19:11:48 +0000 (20:11 +0100)
committerJeremy Thomas <bbxdesign@gmail.com>
Sun, 8 Apr 2018 19:15:06 +0000 (20:15 +0100)
CHANGELOG.md
docs/_data/variables/utilities/initial-variables.json
docs/documentation/overview/responsiveness.html
sass/elements/container.sass
sass/utilities/initial-variables.sass
sass/utilities/mixins.sass

index 29dc78623ebaa00b69122425930c69c4763c3e9e..49e2e650cc19a403bcc098be05ed0b3d391026e3 100644 (file)
@@ -4,6 +4,7 @@
 
 ### New features
 
+* New variables `$widescreen-enabled` and `$fullhd-enabled`: you can set them to `false` to disable each breakpoint
 * New variables `$control-border-width` and `$button-border-width`
 * ðŸŽ‰ #1624 Add some common photography aspect ratios and portrait ratios
 * ðŸŽ‰ #1747 New `$custom-colors` and `$custom-shades` variable for adding your own colors and shades to Bulma's `$colors` and `$shades` maps respectively
index 4b5c7b87de4f8a6e5f2dfc9b20d0bce82fdf9ddb..c7d89b0af6b5f709e2c7a452fe959dcd238e922e 100644 (file)
       "name": "$widescreen",
       "value": "1152px + (2 * $gap)"
     },
+    "widescreen-enabled": {
+      "id": "widescreen-enabled",
+      "name": "$widescreen-enabled",
+      "value": "true"
+    },
     "fullhd": {
       "id": "fullhd",
       "name": "$fullhd",
       "value": "1344px + (2 * $gap)"
     },
+    "fullhd-enabled": {
+      "id": "fullhd-enabled",
+      "name": "$fullhd-enabled",
+      "value": "true"
+    },
     "easing": {
       "id": "easing",
       "name": "$easing",
index 6f2dd62cdd347f1432010cb2d4330f7b505e4d20..b2132150a6f8bb3056551b19ab62237794f0ba46 100644 (file)
@@ -11,6 +11,14 @@ variables_keys:
 - fullhd
 ---
 
+{% capture scss_code %}
+// Disable the widescreen breakpoint
+$widescreen-enabled: false
+
+// Disable the fullhd breakpoint
+$fullhd-enabled: false
+{% endcapture %}
+
 {% include subnav/subnav-overview.html %}
 
 <section class="section">
@@ -42,7 +50,7 @@ variables_keys:
       <ul>
         {% for breakpoint_hash in site.data.breakpoints %}
           {% assign breakpoint = breakpoint_hash[1] %}
-          <li>{% if breakpoint.id == 'fullhd' %}<span class="tag is-success">New!</span> {% endif %}<code>{{ breakpoint.id }}</code>: {% if breakpoint.id == 'mobile' %}up to <code>{{ breakpoint.to }}px</code>{% else %}from <code>{{ breakpoint.from }}px</code>{% endif %}</li>
+          <li><code>{{ breakpoint.id }}</code>: {% if breakpoint.id == 'mobile' %}up to <code>{{ breakpoint.to }}px</code>{% else %}from <code>{{ breakpoint.from }}px</code>{% endif %}</li>
         {% endfor %}
       </ul>
 
@@ -58,7 +66,6 @@ variables_keys:
               </li>
             {% when 'fullhd' %}
               <li>
-                <span class="tag is-success">New!</span>
                 <code>={{ breakpoint.id }}</code><br>
                 from <code>{{ breakpoint.from }}px</code>
               </li>
@@ -182,9 +189,39 @@ variables_keys:
             <p class="notification">-</p>
           </td>
         </tr>
+        <tr>
+          <td colspan="3">
+            <p class="notification is-success">until-widescreen</p>
+          </td>
+          <td colspan="2">
+            <p class="notification">-</p>
+          </td>
+        </tr>
+        <tr>
+          <td colspan="4">
+            <p class="notification is-success">until-fullhd</p>
+          </td>
+          <td colspan="1">
+            <p class="notification">-</p>
+          </td>
+        </tr>
       </tbody>
     </table>
 
+    {% include anchor.html name="Disabling breakpoints" %}
+
+    {% include elements/new-tag.html version="0.6.3" %}
+
+    <div class="content">
+      <p>
+        By default, the <code>$widecreen</code> and <code>$fullhd</code> breakpoints are <strong>enabled</strong>. You can disable them by setting the corresponding Sass boolean to <code>false</code>:
+      </p>
+    </div>
+
+    <div class="highlight-full">
+      {% highlight sass %}{{ scss_code }}{% endhighlight %}
+    </div>
+
     {% include anchor.html name="Variables" %}
 
     <div class="content">
index 3a2158f5fda43129d726cef87ace58137d4e7c6d..2aaf591aec594e6a8e0faf3484a119a44365cb41 100644 (file)
@@ -1,7 +1,7 @@
 .container
   margin: 0 auto
   position: relative
-  +from($desktop)
+  +desktop
     max-width: $desktop - (2 * $gap)
     width: $desktop - (2 * $gap)
     &.is-fluid
@@ -9,17 +9,17 @@
       margin-right: $gap
       max-width: none
       width: auto
-  +until($widescreen)
+  +until-widescreen
     &.is-widescreen
       max-width: $widescreen - (2 * $gap)
       width: auto
-  +until($fullhd)
+  +until-fullhd
     &.is-fullhd
       max-width: $fullhd - (2 * $gap)
       width: auto
-  +from($widescreen)
+  +widescreen
     max-width: $widescreen - (2 * $gap)
     width: $widescreen - (2 * $gap)
-  +from($fullhd)
+  +fullhd
     max-width: $fullhd - (2 * $gap)
-    width: $fullhd - (2 * $gap)
\ No newline at end of file
+    width: $fullhd - (2 * $gap)
index d138cea657e464eac9a8a1d351bc5622eec2a43f..6a9ad80c77525fafc0d3b0ae6891b86528b5e73a 100644 (file)
@@ -53,8 +53,10 @@ $tablet: 769px !default
 $desktop: 960px + (2 * $gap) !default
 // 1152px container + 4rem
 $widescreen: 1152px + (2 * $gap) !default
+$widescreen-enabled: true !default
 // 1344px container + 4rem
 $fullhd: 1344px + (2 * $gap) !default
+$fullhd-enabled: true !default
 
 // Miscellaneous
 
index 7ce258c5999e721377b10077a96ba76ba8f41372..ccc89b3b006f80b7490ee6cc1c26cb640330289c 100644 (file)
     @content
 
 =desktop-only
-  @media screen and (min-width: $desktop) and (max-width: $widescreen - 1px)
-    @content
+  @if $widescreen-enabled
+    @media screen and (min-width: $desktop) and (max-width: $widescreen - 1px)
+      @content
+
+=until-widescreen
+  @if $widescreen-enabled
+    @media screen and (max-width: $widescreen - 1px)
+      @content
 
 =widescreen
-  @media screen and (min-width: $widescreen)
-    @content
+  @if $widescreen-enabled
+    @media screen and (min-width: $widescreen)
+      @content
 
 =widescreen-only
-  @media screen and (min-width: $widescreen) and (max-width: $fullhd - 1px)
-    @content
+  @if $widescreen-enabled and $fullhd-enabled
+    @media screen and (min-width: $widescreen) and (max-width: $fullhd - 1px)
+      @content
+
+=until-fullhd
+  @if $fullhd-enabled
+    @media screen and (max-width: $fullhd - 1px)
+      @content
 
 =fullhd
-  @media screen and (min-width: $fullhd)
-    @content
+  @if $fullhd-enabled
+    @media screen and (min-width: $fullhd)
+      @content
 
 // Placeholders