From: Jeremy Thomas Date: Sun, 10 Apr 2016 15:27:27 +0000 (+0100) Subject: Fix components code style X-Git-Tag: 0.0.18~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0dbb77c215820c980ed9fa38c27774b6560c0b25;p=thirdparty%2Fbulma.git Fix components code style --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 627c6061b..d849382ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ * `.is-text-*` renamed to `.has-text-*` * `.is-gapless` renamed to `.has-no-gap` -* `.is-marginless` renamed to `.has-no-margin` +* removed `.is-fullwidth` helper ### Added diff --git a/bulma/base/helpers.sass b/bulma/base/helpers.sass index 25a87d04a..3186ae426 100644 --- a/bulma/base/helpers.sass +++ b/bulma/base/helpers.sass @@ -19,11 +19,6 @@ .is-overlay +overlay -// Size - -.is-fullwidth - width: 100% - // Text .has-text-centered @@ -55,12 +50,11 @@ // Other -.has-no-margin - margin: 0 !important - .is-disabled pointer-events: none +.is-marginless + margin: 0 !important + .is-unselectable +unselectable - diff --git a/bulma/components/card.sass b/bulma/components/card.sass index 8aa69d254..4f119a1ad 100644 --- a/bulma/components/card.sass +++ b/bulma/components/card.sass @@ -51,7 +51,8 @@ width: 300px .media:not(:last-child) margin-bottom: 10px - &.is-rounded - border-radius: 5px + // Modifiers &.is-fullwidth width: 100% + &.is-rounded + border-radius: 5px diff --git a/bulma/components/media.sass b/bulma/components/media.sass index d6cdae3f0..90397ad2d 100644 --- a/bulma/components/media.sass +++ b/bulma/components/media.sass @@ -9,6 +9,7 @@ padding: 4px 8px text-align: center vertical-align: top + // Responsiveness +mobile margin-bottom: 10px +tablet @@ -50,10 +51,12 @@ border-top: 1px solid rgba($border, 0.5) margin-top: 10px padding-top: 10px + // Sizes &.is-large & + .media margin-top: 20px padding-top: 20px + // Responsiveness +tablet &.is-large .media-number diff --git a/bulma/components/menu.sass b/bulma/components/menu.sass index 3e9222868..b8040db2f 100644 --- a/bulma/components/menu.sass +++ b/bulma/components/menu.sass @@ -12,13 +12,15 @@ &:hover background: $background color: $link + // Modifiers &.is-active background: $link color: $link-invert - li ul - border-left: 1px solid $border - margin: 10px - padding-left: 10px + li + ul + border-left: 1px solid $border + margin: 10px + padding-left: 10px .menu-label color: $text-light diff --git a/bulma/components/modal.sass b/bulma/components/modal.sass index 89e09fd22..87e7843eb 100644 --- a/bulma/components/modal.sass +++ b/bulma/components/modal.sass @@ -8,6 +8,7 @@ overflow: auto position: relative width: 100% + // Responsiveness +tablet margin: 0 auto max-height: calc(100vh - 40px) @@ -30,5 +31,6 @@ overflow: hidden position: fixed z-index: 1986 + // Modifiers &.is-active display: flex diff --git a/bulma/components/navbar.sass b/bulma/components/navbar.sass index a1b36b0a5..1668b42a2 100644 --- a/bulma/components/navbar.sass +++ b/bulma/components/navbar.sass @@ -2,34 +2,22 @@ .title, .subtitle margin-bottom: 0 + // Responsiveness +mobile &:not(:last-child) margin-bottom: 10px -.navbar - @extend .block - code - border-radius: $radius - img - display: inline-block - vertical-align: top - +tablet - align-items: center - display: flex - justify-content: space-between - & > .navbar-item - &:not(.is-narrow) - flex: 1 - .navbar-left, .navbar-right .navbar-item - &.is-flexible - flex: 1 &:not(:last-child) margin-right: 10px + // Modifiers + &.is-flexible + flex: 1 .navbar-left + // Responsiveness +mobile & + .navbar-right margin-top: 20px @@ -38,7 +26,24 @@ display: flex .navbar-right + // Responsiveness +tablet align-items: center display: flex justify-content: flex-end + +.navbar + @extend .block + code + border-radius: $radius + img + display: inline-block + vertical-align: top + // Responsiveness + +tablet + align-items: center + display: flex + justify-content: space-between + & > .navbar-item + &:not(.is-narrow) + flex: 1 diff --git a/bulma/components/pagination.sass b/bulma/components/pagination.sass index 78e12496f..c154db768 100644 --- a/bulma/components/pagination.sass +++ b/bulma/components/pagination.sass @@ -8,6 +8,7 @@ display: block min-width: 32px padding: 3px 8px + // Modifiers &.is-active background: $link border-color: $link @@ -23,6 +24,7 @@ display: flex flex: 1 justify-content: center + // Responsiveness +mobile flex-wrap: wrap & > a diff --git a/bulma/components/panel.sass b/bulma/components/panel.sass index 0d2692877..32af2acd8 100644 --- a/bulma/components/panel.sass +++ b/bulma/components/panel.sass @@ -27,47 +27,26 @@ font-size: $size-small padding: 5px 10px 0 justify-content: center - &:not(:last-child) - border-bottom: 1px solid $border a border-bottom: 1px solid $border margin-bottom: -1px padding: 5px + // Modifiers &.is-active border-bottom-color: $link-active-border color: $link-active + &:not(:last-child) + border-bottom: 1px solid $border .panel-block color: $text-strong display: block line-height: 16px padding: 10px + &:hover + background: $background &:not(:last-child) border-bottom: 1px solid $border - .checkbox - border: 1px solid transparent - border-radius: $radius - display: block - padding: 8px - padding-left: 32px - input - left: 9px - top: 9px - &:hover - border-color: $link - -a.panel-block:hover - background: $background - -.panel-checkbox - @extend .checkbox - display: block - padding: 9px 10px 9px 30px - &:not(:last-child) - border-bottom: 1px solid $border - input - left: 8px - top: 10px .panel border: 1px solid $border diff --git a/bulma/components/table.sass b/bulma/components/table.sass index b249e98a8..47bfeb642 100644 --- a/bulma/components/table.sass +++ b/bulma/components/table.sass @@ -3,15 +3,24 @@ color: $text-strong margin-bottom: 20px width: 100% - th, - td + td, + th border: 1px solid $border border-width: 0 0 1px padding: 8px 10px vertical-align: top - &.table-narrow + // Modifiers + &.table-icon + padding: 5px + text-align: center white-space: nowrap width: 1% + .fa + +fa(21px, 24px) + &.table-link + padding: 0 + & > a + padding: 5px &.table-link padding: 0 & > a @@ -20,60 +29,61 @@ &:hover background: $link color: $link-invert - &.table-icon - padding: 5px - text-align: center + &.table-narrow white-space: nowrap width: 1% - .fa - +fa(21px, 24px) - &.table-link - padding: 0 - & > a - padding: 5px th color: $text-strong text-align: left tr &:hover - background: rgba($background, 0.5) + background: $background color: $text-strong - &:last-child td - border-bottom-width: 0 thead - th, - td + td, + th border-width: 0 0 2px color: $text-light + tbody + tr + &:last-child + td, + th + border-bottom-width: 0 tfoot - th, - td + td, + th border-width: 2px 0 0 color: $text-light + // Modifiers &.is-bordered - th, - td + td, + th border-width: 1px tr - &:last-child td - border-bottom-width: 1px + &:last-child + td, + th + border-bottom-width: 1px &.is-narrow - th, - td + td, + th padding: 5px 10px - &.table-link - padding: 0 - & > a - padding: 5px 10px + // Modifiers &.table-icon padding: 2px &.table-link padding: 0 & > a padding: 2px + &.table-link + padding: 0 + & > a + padding: 5px 10px &.is-striped tbody - tr:nth-child(2n) - background: rgba($background, 0.5) - &:hover + tr + &:nth-child(2n) background: $background + &:hover + background: $border diff --git a/bulma/components/tabs.sass b/bulma/components/tabs.sass index df7b934c3..1522654a1 100644 --- a/bulma/components/tabs.sass +++ b/bulma/components/tabs.sass @@ -4,11 +4,6 @@ overflow: hidden overflow-x: auto white-space: nowrap - .fa - font-size: 14px - line-height: 20px - margin: 2px -2px - width: 20px a border-bottom: 1px solid $border color: $text @@ -24,6 +19,7 @@ vertical-align: top & + li margin-left: 20px + // Modifiers &.is-active a border-bottom-color: $link @@ -31,18 +27,12 @@ ul border-bottom: 1px solid $border display: flex - &.is-centered - a - padding: 5px 10px - li - & + li - margin-left: 0 - ul - justify-content: center - text-align: center - &.is-right - ul - justify-content: flex-end + .fa + font-size: 14px + line-height: 20px + margin: 2px -2px + width: 20px + // Modifiers &.is-boxed a border: 1px solid transparent @@ -54,16 +44,38 @@ li & + li margin-left: 5px + // Modifiers &.is-active a background: white border-color: $border border-bottom-color: transparent + // Modifiers &.is-centered li &, & + li margin: 0 2px + &.is-centered + a + padding: 5px 10px + li + & + li + margin-left: 0 + ul + justify-content: center + text-align: center + &.is-fullwidth + li + flex: 1 + & + li + margin-left: 0 + ul + justify-content: center + text-align: center + &.is-right + ul + justify-content: flex-end &.is-toggle a border: 1px solid $border @@ -81,6 +93,7 @@ border-radius: $radius 0 0 $radius &:last-child a border-radius: 0 $radius $radius 0 + // Modifiers &.is-active a background: $primary @@ -89,11 +102,3 @@ z-index: 1 ul border-bottom: none - &.is-fullwidth - li - flex: 1 - & + li - margin-left: 0 - ul - justify-content: center - text-align: center