From: Jeremy Thomas Date: Sun, 8 Apr 2018 19:11:48 +0000 (+0100) Subject: Fix #1759 X-Git-Tag: 0.7.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=740df6a0fa74383707e39b609dc46534d52c14a0;p=thirdparty%2Fbulma.git Fix #1759 --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 29dc78623..49e2e650c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docs/_data/variables/utilities/initial-variables.json b/docs/_data/variables/utilities/initial-variables.json index 4b5c7b87d..c7d89b0af 100644 --- a/docs/_data/variables/utilities/initial-variables.json +++ b/docs/_data/variables/utilities/initial-variables.json @@ -196,11 +196,21 @@ "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", diff --git a/docs/documentation/overview/responsiveness.html b/docs/documentation/overview/responsiveness.html index 6f2dd62cd..b2132150a 100644 --- a/docs/documentation/overview/responsiveness.html +++ b/docs/documentation/overview/responsiveness.html @@ -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 %}
@@ -42,7 +50,7 @@ variables_keys: @@ -58,7 +66,6 @@ variables_keys: {% when 'fullhd' %}
  • - New! ={{ breakpoint.id }}
    from {{ breakpoint.from }}px
  • @@ -182,9 +189,39 @@ variables_keys:

    -

    + + +

    until-widescreen

    + + +

    -

    + + + + +

    until-fullhd

    + + +

    -

    + + + {% include anchor.html name="Disabling breakpoints" %} + + {% include elements/new-tag.html version="0.6.3" %} + +
    +

    + By default, the $widecreen and $fullhd breakpoints are enabled. You can disable them by setting the corresponding Sass boolean to false: +

    +
    + +
    + {% highlight sass %}{{ scss_code }}{% endhighlight %} +
    + {% include anchor.html name="Variables" %}
    diff --git a/sass/elements/container.sass b/sass/elements/container.sass index 3a2158f5f..2aaf591ae 100644 --- a/sass/elements/container.sass +++ b/sass/elements/container.sass @@ -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) diff --git a/sass/utilities/initial-variables.sass b/sass/utilities/initial-variables.sass index d138cea65..6a9ad80c7 100644 --- a/sass/utilities/initial-variables.sass +++ b/sass/utilities/initial-variables.sass @@ -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 diff --git a/sass/utilities/mixins.sass b/sass/utilities/mixins.sass index 7ce258c59..ccc89b3b0 100644 --- a/sass/utilities/mixins.sass +++ b/sass/utilities/mixins.sass @@ -99,20 +99,34 @@ @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