| 1 |
@import "../utilities/mixins" |
| 2 |
|
| 3 |
$tag-background-color: $background !default |
| 4 |
$tag-color: $text !default |
| 5 |
$tag-radius: $radius !default |
| 6 |
$tag-delete-margin: 1px !default |
| 7 |
|
| 8 |
$tag-colors: $colors !default |
| 9 |
|
| 10 |
.tags |
| 11 |
align-items: center |
| 12 |
display: flex |
| 13 |
flex-wrap: wrap |
| 14 |
justify-content: flex-start |
| 15 |
.tag |
| 16 |
margin-bottom: 0.5rem |
| 17 |
&:not(:last-child) |
| 18 |
+ltr-property("margin", 0.5rem) |
| 19 |
&:last-child |
| 20 |
margin-bottom: -0.5rem |
| 21 |
&:not(:last-child) |
| 22 |
margin-bottom: 1rem |
| 23 |
// Sizes |
| 24 |
&.are-medium |
| 25 |
.tag:not(.is-normal):not(.is-large) |
| 26 |
font-size: $size-normal |
| 27 |
&.are-large |
| 28 |
.tag:not(.is-normal):not(.is-medium) |
| 29 |
font-size: $size-medium |
| 30 |
&.is-centered |
| 31 |
justify-content: center |
| 32 |
.tag |
| 33 |
margin-right: 0.25rem |
| 34 |
margin-left: 0.25rem |
| 35 |
&.is-right |
| 36 |
justify-content: flex-end |
| 37 |
.tag |
| 38 |
&:not(:first-child) |
| 39 |
margin-left: 0.5rem |
| 40 |
&:not(:last-child) |
| 41 |
margin-right: 0 |
| 42 |
&.has-addons |
| 43 |
.tag |
| 44 |
+ltr-property("margin", 0) |
| 45 |
&:not(:first-child) |
| 46 |
+ltr-property("margin", 0, false) |
| 47 |
+ltr |
| 48 |
border-top-left-radius: 0 |
| 49 |
border-bottom-left-radius: 0 |
| 50 |
+rtl |
| 51 |
border-top-right-radius: 0 |
| 52 |
border-bottom-right-radius: 0 |
| 53 |
&:not(:last-child) |
| 54 |
+ltr |
| 55 |
border-top-right-radius: 0 |
| 56 |
border-bottom-right-radius: 0 |
| 57 |
+rtl |
| 58 |
border-top-left-radius: 0 |
| 59 |
border-bottom-left-radius: 0 |
| 60 |
|
| 61 |
.tag:not(body) |
| 62 |
align-items: center |
| 63 |
background-color: $tag-background-color |
| 64 |
border-radius: $tag-radius |
| 65 |
color: $tag-color |
| 66 |
display: inline-flex |
| 67 |
font-size: $size-small |
| 68 |
height: 2em |
| 69 |
justify-content: center |
| 70 |
line-height: 1.5 |
| 71 |
padding-left: 0.75em |
| 72 |
padding-right: 0.75em |
| 73 |
white-space: nowrap |
| 74 |
.delete |
| 75 |
+ltr-property("margin", 0.25rem, false) |
| 76 |
+ltr-property("margin", -0.375rem) |
| 77 |
// Colors |
| 78 |
@each $name, $pair in $tag-colors |
| 79 |
$color: nth($pair, 1) |
| 80 |
$color-invert: nth($pair, 2) |
| 81 |
&.is-#{$name} |
| 82 |
background-color: $color |
| 83 |
color: $color-invert |
| 84 |
// If a light and dark colors are provided |
| 85 |
@if length($pair) > 3 |
| 86 |
$color-light: nth($pair, 3) |
| 87 |
$color-dark: nth($pair, 4) |
| 88 |
&.is-light |
| 89 |
background-color: $color-light |
| 90 |
color: $color-dark |
| 91 |
// Sizes |
| 92 |
&.is-normal |
| 93 |
font-size: $size-small |
| 94 |
&.is-medium |
| 95 |
font-size: $size-normal |
| 96 |
&.is-large |
| 97 |
font-size: $size-medium |
| 98 |
.icon |
| 99 |
&:first-child:not(:last-child) |
| 100 |
+ltr-property("margin", -0.375em, false) |
| 101 |
+ltr-property("margin", 0.1875em) |
| 102 |
&:last-child:not(:first-child) |
| 103 |
+ltr-property("margin", 0.1875em, false) |
| 104 |
+ltr-property("margin", -0.375em) |
| 105 |
&:first-child:last-child |
| 106 |
+ltr-property("margin", -0.375em, false) |
| 107 |
+ltr-property("margin", -0.375em) |
| 108 |
// Modifiers |
| 109 |
&.is-delete |
| 110 |
+ltr-property("margin", $tag-delete-margin, false) |
| 111 |
padding: 0 |
| 112 |
position: relative |
| 113 |
width: 2em |
| 114 |
&::before, |
| 115 |
&::after |
| 116 |
background-color: currentColor |
| 117 |
content: "" |
| 118 |
display: block |
| 119 |
left: 50% |
| 120 |
position: absolute |
| 121 |
top: 50% |
| 122 |
transform: translateX(-50%) translateY(-50%) rotate(45deg) |
| 123 |
transform-origin: center center |
| 124 |
&::before |
| 125 |
height: 1px |
| 126 |
width: 50% |
| 127 |
&::after |
| 128 |
height: 50% |
| 129 |
width: 1px |
| 130 |
&:hover, |
| 131 |
&:focus |
| 132 |
background-color: darken($tag-background-color, 5%) |
| 133 |
&:active |
| 134 |
background-color: darken($tag-background-color, 10%) |
| 135 |
&.is-rounded |
| 136 |
border-radius: $radius-rounded |
| 137 |
|
| 138 |
a.tag |
| 139 |
&:hover |
| 140 |
text-decoration: underline |