]> git.ipfire.org Git - thirdparty/bulma.git/commitdiff
Rename LTR mixins
authorJeremy Thomas <bbxdesign@gmail.com>
Wed, 22 Jan 2020 09:14:04 +0000 (09:14 +0000)
committerJeremy Thomas <bbxdesign@gmail.com>
Wed, 22 Jan 2020 09:14:04 +0000 (09:14 +0000)
15 files changed:
sass/components/breadcrumb.sass
sass/components/card.sass
sass/components/dropdown.sass
sass/components/level.sass
sass/components/media.sass
sass/components/menu.sass
sass/components/message.sass
sass/components/modal.sass
sass/components/panel.sass
sass/components/tabs.sass
sass/elements/button.sass
sass/elements/content.sass
sass/elements/notification.sass
sass/form/tools.sass
sass/utilities/mixins.sass

index d4ec476019441414f52fbd6fbc518ef3059e03dd..f42b0b841aea10854573f5e2a44b36c46ece1bd5 100644 (file)
@@ -24,7 +24,7 @@ $breadcrumb-item-separator-color: $border-hover !default
     align-items: center
     display: flex
     &:first-child a
-      +directioner("padding", 0, false)
+      +ltr-property("padding", 0, false)
     &.is-active
       a
         color: $breadcrumb-item-active-color
@@ -41,9 +41,9 @@ $breadcrumb-item-separator-color: $border-hover !default
     justify-content: flex-start
   .icon
     &:first-child
-      +directioner("margin", 0.5em)
+      +ltr-property("margin", 0.5em)
     &:last-child
-      +directioner("margin", 0.5em, false)
+      +ltr-property("margin", 0.5em, false)
   // Alignment
   &.is-centered
     ol,
index 3cdf0008f183576aeae0e839be19ea7c4a043c75..db1e5d9b48bae25dfca9a758c22b2b7e32f25201 100644 (file)
@@ -70,7 +70,7 @@ $card-media-margin: $block-spacing !default
   justify-content: center
   padding: $card-footer-padding
   &:not(:last-child)
-    border-right: $card-footer-border-top
+    +ltr-property("border", $card-footer-border-top)
 
 // Combinations
 
index 4eea912454714874856f6e78457d93bb76527aa5..62cb66e4a18313da171fed83fb5046291490ee8c 100644 (file)
@@ -38,7 +38,7 @@ $dropdown-divider-background-color: $border-light !default
 
 .dropdown-menu
   display: none
-  left: 0
+  +ltr-position(0, false)
   min-width: $dropdown-menu-min-width
   padding-top: $dropdown-content-offset
   position: absolute
@@ -62,7 +62,7 @@ $dropdown-divider-background-color: $border-light !default
 
 a.dropdown-item,
 button.dropdown-item
-  +directioner("padding", 3rem)
+  +ltr-property("padding", 3rem)
   text-align: inherit
   white-space: nowrap
   width: 100%
index 696dc1c9d174c57c44a7f9d7d0ae2ffe53ce97b2..8f7312025dbe8e154cbf0fd14a2fbe651ee03bae 100644 (file)
@@ -20,7 +20,7 @@ $level-item-spacing: ($block-spacing / 2) !default
     .level-item
       &:not(:last-child)
         margin-bottom: 0
-        +directioner("margin", $level-item-spacing)
+        +ltr-property("margin", $level-item-spacing)
       &:not(.is-narrow)
         flex-grow: 1
   // Responsiveness
@@ -57,7 +57,7 @@ $level-item-spacing: ($block-spacing / 2) !default
     // Responsiveness
     +tablet
       &:not(:last-child)
-        +directioner("margin", $level-item-spacing)
+        +ltr-property("margin", $level-item-spacing)
 
 .level-left
   align-items: center
index 1f3919115788a4c83cdaf36fb0f1ff8b288e9864..777755b2f1f5019cbc0c3a22a2f3a79d9033a113 100644 (file)
@@ -35,6 +35,12 @@ $media-spacing-large: 1.5rem
   flex-grow: 0
   flex-shrink: 0
 
+.media-left
+  +ltr-property("margin", $media-spacing)
+
+.media-right
+  +ltr-property("margin", $media-spacing, false)
+
 .media-content
   flex-basis: auto
   flex-grow: 1
@@ -44,15 +50,3 @@ $media-spacing-large: 1.5rem
 +mobile
   .media-content
     overflow-x: auto
-
-+ltr
-  .media-left
-    margin-right: $media-spacing
-  .media-right
-    margin-left: $media-spacing
-
-+rtl
-  .media-left
-    margin-left: $media-spacing
-  .media-right
-    margin-right: $media-spacing
index 3de7e18db086f0187768e63873bb7caa65d412a3..1bf782977878842214a43724f23a1c9430864408 100644 (file)
@@ -42,9 +42,9 @@ $menu-label-spacing: 1em !default
       color: $menu-item-active-color
   li
     ul
-      border-left: $menu-list-border-left
+      +ltr-property("border", $menu-list-border-left, false)
       margin: $menu-nested-list-margin
-      padding-left: $menu-nested-list-padding-left
+      +ltr-property("padding", $menu-nested-list-padding-left, false)
 
 .menu-label
   color: $menu-label-color
index 4144dff6dbeda327f210901218984bdcf9d35d9e..180fbe94146d266338cfd164abee67240c866dec 100644 (file)
@@ -79,7 +79,7 @@ $message-colors: $colors !default
   .delete
     flex-grow: 0
     flex-shrink: 0
-    +directioner("margin", 0.75em, false)
+    +ltr-property("margin", 0.75em, false)
   & + .message-body
     border-width: $message-header-body-border-width
     border-top-left-radius: 0
index 377dfa78f5d7e1ab40aa57b3553c5206b3e6d5ba..f352744a47443fe8ef32fa0d9262a2e82e11312d 100644 (file)
@@ -63,7 +63,7 @@ $modal-card-body-padding: 20px !default
   background: none
   height: $modal-close-dimensions
   position: fixed
-  right: $modal-close-right
+  +ltr-position($modal-close-right)
   top: $modal-close-top
   width: $modal-close-dimensions
 
@@ -102,7 +102,7 @@ $modal-card-body-padding: 20px !default
   border-top: $modal-card-foot-border-top
   .button
     &:not(:last-child)
-      margin-right: 0.5em
+      +ltr-property("margin", 0.5em)
 
 .modal-card-body
   +overflow-touch
index c000073941c7d40c1bddd2b2c2f4409b49121009..2f7e2754e97d513fa0d772d95607aca06035993a 100644 (file)
@@ -88,7 +88,7 @@ $panel-colors: $colors !default
   justify-content: flex-start
   padding: 0.5em 0.75em
   input[type="checkbox"]
-    +directioner("margin", 0.75em)
+    +ltr-property("margin", 0.75em)
   & > .control
     flex-grow: 1
     flex-shrink: 1
@@ -113,7 +113,7 @@ label.panel-block
 .panel-icon
   +fa(14px, 1em)
   color: $panel-icon-color
-  +directioner("margin", 0.75em)
+  +ltr-property("margin", 0.75em)
   .fa
     font-size: inherit
     line-height: inherit
index 1dc470413f76b8afe1096846507432cb7ba9f8c3..81bda599330076cc9bc1b8fa0914157cdd1636fa 100644 (file)
@@ -78,9 +78,9 @@ $tabs-toggle-link-active-color: $link-invert !default
       padding-left: 0.75em
   .icon
     &:first-child
-      +directioner("margin", 0.5em)
+      +ltr-property("margin", 0.5em)
     &:last-child
-      +directioner("margin", 0.5em, false)
+      +ltr-property("margin", 0.5em, false)
   // Alignment
   &.is-centered
     ul
@@ -122,7 +122,7 @@ $tabs-toggle-link-active-color: $link-invert !default
         z-index: 2
     li
       & + li
-        +directioner("margin", -#{$tabs-toggle-link-border-width}, false)
+        +ltr-property("margin", -#{$tabs-toggle-link-border-width}, false)
       &:first-child a
         +ltr
           border-radius: $tabs-toggle-link-radius 0 0 $tabs-toggle-link-radius
index eb7a29ac4ba8ebfba0fa7c3c9d5f34af229798c3..4edbed39be36b520b2904618eb70f3fad5865a06 100644 (file)
@@ -71,11 +71,11 @@ $button-static-border-color: $border !default
       height: 1.5em
       width: 1.5em
     &:first-child:not(:last-child)
-      +directioner("margin", calc(#{-1 / 2 * $button-padding-horizontal} - #{$button-border-width}), false)
-      +directioner("margin", $button-padding-horizontal / 4)
+      +ltr-property("margin", calc(#{-1 / 2 * $button-padding-horizontal} - #{$button-border-width}), false)
+      +ltr-property("margin", $button-padding-horizontal / 4)
     &:last-child:not(:first-child)
-      +directioner("margin", $button-padding-horizontal / 4, false)
-      +directioner("margin", calc(#{-1 / 2 * $button-padding-horizontal} - #{$button-border-width}))
+      +ltr-property("margin", $button-padding-horizontal / 4, false)
+      +ltr-property("margin", calc(#{-1 / 2 * $button-padding-horizontal} - #{$button-border-width}))
     &:first-child:last-child
       margin-left: calc(#{-1 / 2 * $button-padding-horizontal} - #{$button-border-width})
       margin-right: calc(#{-1 / 2 * $button-padding-horizontal} - #{$button-border-width})
@@ -269,7 +269,7 @@ $button-static-border-color: $border !default
   .button
     margin-bottom: 0.5rem
     &:not(:last-child):not(.is-fullwidth)
-      +directioner("margin", 0.5rem)
+      +ltr-property("margin", 0.5rem)
   &:last-child
     margin-bottom: -0.5rem
   &:not(:last-child)
index 32867cd2644defdedde047fb3ac5ea97759894ad..800268b74b7c966d027bf5b6858a7f8c846e4c91 100644 (file)
@@ -67,11 +67,11 @@ $content-table-foot-cell-color: $text-strong !default
     margin-bottom: 1em
   blockquote
     background-color: $content-blockquote-background-color
-    +directioner("border", $content-blockquote-border-left, false)
+    +ltr-property("border", $content-blockquote-border-left, false)
     padding: $content-blockquote-padding
   ol
     list-style-position: outside
-    +directioner("margin", 2em, false)
+    +ltr-property("margin", 2em, false)
     margin-top: 1em
     &:not([type])
       list-style-type: decimal
@@ -85,7 +85,7 @@ $content-table-foot-cell-color: $text-strong !default
         list-style-type: upper-roman
   ul
     list-style: disc outside
-    +directioner("margin", 2em, false)
+    +ltr-property("margin", 2em, false)
     margin-top: 1em
     ul
       list-style-type: circle
@@ -93,7 +93,7 @@ $content-table-foot-cell-color: $text-strong !default
       ul
         list-style-type: square
   dd
-    +directioner("margin", 2em, false)
+    +ltr-property("margin", 2em, false)
   figure
     margin-left: 2em
     margin-right: 2em
index 8e3125ea0c5cf4455d0751c8f516c960e97faac9..af1c7be5917c62166b2de8bdd11554585018b91a 100644 (file)
@@ -25,7 +25,7 @@ $notification-padding-rtl: 1.25rem 1.5rem 1.25rem 2.5rem !default
   pre code
     background: transparent
   & > .delete
-    +right(0.5rem)
+    +ltr-position(0.5rem)
     position: absolute
     top: 0.5rem
   .title,
index 7b143dc469c26a202c53aeb7050560c16d2e6df2..d97427c409c0aee877c8b7e090d304f0f8e26767 100644 (file)
@@ -38,7 +38,7 @@ $help-size: $size-small !default
     justify-content: flex-start
     .control
       &:not(:last-child)
-        +directioner("margin", -1px)
+        +ltr-property("margin", -1px)
       &:not(:first-child):not(:last-child)
         .button,
         .input,
@@ -96,7 +96,7 @@ $help-size: $size-small !default
       flex-shrink: 0
       &:not(:last-child)
         margin-bottom: 0
-        +directioner("margin", 0.75rem)
+        +ltr-property("margin", 0.75rem)
       &.is-expanded
         flex-grow: 1
         flex-shrink: 1
@@ -127,7 +127,7 @@ $help-size: $size-small !default
     flex-basis: 0
     flex-grow: 1
     flex-shrink: 0
-    +directioner("margin", 1.5rem)
+    +ltr-property("margin", 1.5rem)
     text-align: right
     &.is-small
       font-size: $size-small
@@ -156,7 +156,7 @@ $help-size: $size-small !default
       &:not(.is-narrow)
         flex-grow: 1
       &:not(:last-child)
-        +directioner("margin", 0.75rem)
+        +ltr-property("margin", 0.75rem)
 
 .control
   box-sizing: border-box
@@ -202,7 +202,7 @@ $help-size: $size-small !default
     &::after
       @extend %loader
       position: absolute !important
-      +right(0.625em)
+      +ltr-position(0.625em)
       top: 0.625em
       z-index: 4
     &.is-small:after
index 4af73d49526cf2a6403aa3484e309aa0b3e3d596..0ed78c1538ad4bd18d08f311cbe829079cf03166 100644 (file)
   @if $rtl
     @content
 
-// $directions: ("left": "right", "right": "left")
-
-=directioner($property, $spacing, $right: true)
+=ltr-property($property, $spacing, $right: true)
   $normal: if($right, "right", "left")
   $opposite: if($right, "left", "right")
   @if $rtl
-    /* RTL */
     #{$property}-#{$opposite}: $spacing
   @else
-    /* LTR */
     #{$property}-#{$normal}: $spacing
 
-=right($spacing)
+=ltr-position($spacing, $right: true)
+  $normal: if($right, "right", "left")
+  $opposite: if($right, "left", "right")
   @if $rtl
-    left: $spacing
+    #{$opposite}: $spacing
   @else
-    right: $spacing
-
-// =directioner($spacing)
-//   @supports (margin-inline-end: 1px)
-//     margin-inline-end: $spacing
-//   @supports
-//     @if $rtl
-//       margin-left: $spacing
-//     @else
-//       margin-right: $spacing
+    #{$normal}: $spacing
 
 // Placeholders