From d28556d8dd386367f00bf9fe4bb887e811869b48 Mon Sep 17 00:00:00 2001 From: Jeremy Thomas Date: Mon, 24 Jul 2017 12:54:00 +0200 Subject: [PATCH] Fix desktop container --- docs/css/bulma-docs.css | 23 +++++-- docs/documentation/components/dropdown.html | 72 +++++++++++++++++++++ sass/components/dropdown.sass | 4 ++ sass/elements/other.sass | 15 +++-- 4 files changed, 100 insertions(+), 14 deletions(-) diff --git a/docs/css/bulma-docs.css b/docs/css/bulma-docs.css index a4a7dcd0..c238e9c1 100644 --- a/docs/css/bulma-docs.css +++ b/docs/css/bulma-docs.css @@ -3429,16 +3429,20 @@ input[type="submit"].button { .container { margin: 0 auto; - max-width: 960px; position: relative; - width: 960px; } -.container.is-fluid { - margin-left: 24px; - margin-right: 24px; - max-width: none; - width: auto; +@media screen and (min-width: 1008px) { + .container { + max-width: 960px; + width: 960px; + } + .container.is-fluid { + margin-left: 24px; + margin-right: 24px; + max-width: none; + width: auto; + } } @media screen and (max-width: 1199px) { @@ -3782,6 +3786,11 @@ input[type="submit"].button { display: block; } +.dropdown.is-right .dropdown-menu { + left: auto; + right: 0; +} + .dropdown-menu { display: none; left: 0; diff --git a/docs/documentation/components/dropdown.html b/docs/documentation/components/dropdown.html index 311ea8e8..20227caa 100644 --- a/docs/documentation/components/dropdown.html +++ b/docs/documentation/components/dropdown.html @@ -127,6 +127,46 @@ doc-subtab: dropdown {% endcapture %} +{% capture dropdown_left_example %} + +{% endcapture %} + +{% capture dropdown_right_example %} + +{% endcapture %} + {% include subnav-components.html %}
@@ -246,5 +286,37 @@ doc-subtab: dropdown {% highlight html %}{{dropdown_click_example}}{{dropdown_info_example}}{% endhighlight %} + +
+ +

+ Right aligned +

+ +
+

+ You can add the is-right modifier to have a right-aligned dropdown. +

+
+ +
+
+
+
+
+ {{dropdown_left_example}} +
+
+
+
+ {{dropdown_right_example}} +
+
+
+
+
+ {% highlight html %}{{dropdown_right_example}}{% endhighlight %} +
+
diff --git a/sass/components/dropdown.sass b/sass/components/dropdown.sass index dffe90f7..b4701f55 100644 --- a/sass/components/dropdown.sass +++ b/sass/components/dropdown.sass @@ -21,6 +21,10 @@ $dropdown-divider-background: $border !default &.is-hoverable:hover .dropdown-menu display: block + &.is-right + .dropdown-menu + left: auto + right: 0 .dropdown-menu display: none diff --git a/sass/elements/other.sass b/sass/elements/other.sass index d40f121f..93d87858 100644 --- a/sass/elements/other.sass +++ b/sass/elements/other.sass @@ -3,14 +3,15 @@ .container margin: 0 auto - max-width: $desktop - (2 * $gap) position: relative - width: $desktop - (2 * $gap) - &.is-fluid - margin-left: $gap - margin-right: $gap - max-width: none - width: auto + +desktop + max-width: $desktop - (2 * $gap) + width: $desktop - (2 * $gap) + &.is-fluid + margin-left: $gap + margin-right: $gap + max-width: none + width: auto +until($widescreen) &.is-widescreen max-width: $widescreen - (2 * $gap)