From 166ed95ec291bc8d33d8b2788edee03ed3e2eb90 Mon Sep 17 00:00:00 2001 From: codecalm Date: Thu, 22 Feb 2018 01:13:37 +0100 Subject: [PATCH] tags docs --- _docs/tags.md | 132 ++++++++++++++++++++++++++++++ assets/scss/dashboard/_chips.scss | 16 ++-- assets/scss/dashboard/_tag.scss | 99 ++++++++++++++++++++-- 3 files changed, 232 insertions(+), 15 deletions(-) create mode 100644 _docs/tags.md diff --git a/_docs/tags.md b/_docs/tags.md new file mode 100644 index 000000000..0440b2298 --- /dev/null +++ b/_docs/tags.md @@ -0,0 +1,132 @@ +--- +title: Tags +icon: fe fe-tag +description: Small tag labels to insert anywhere +--- + +### Default tag + +{% example html wrapper=tags %} +First tag +Second tag +Third tag +{% endexample %} + +### Link tag + +{% example html wrapper=tags %} +First tag +Second tag +Third tag +{% endexample %} + +### Rounded tag + +{% example html wrapper=tags %} +First tag +Second tag +Third tag +{% endexample %} + +### Color tag + +{% example html wrapper=tags %} +{% for color in site.colors %} +{{ color[1].name }} tag +{% endfor %} +{% endexample %} + +### Avatar tag + +{% example html wrapper=tags %} +{% for user in site.data.users limit: 8 %} + + + {{ user.name }} + +{% endfor %} +{% endexample %} + +### List of tags + +You can create a list of tags with the `.tags` container. + +{% example html %} +
+ First tag + Second tag + Third tag +
+{% endexample %} + +If the list is very long, it will automatically wrap on multiple lines, while keeping all tags evenly spaced. + +{% example html %} +
+ One + Two + Three + Four + Five + Six + Seven + Eight + Nine + Ten + Eleven + Twelve + Thirteen + Fourteen + Fifteen + Sixteen + Seventeen + Eighteen + Nineteen + Twenty +
+{% endexample %} + + +### Tag remove + +{% example html %} +
+ + One + + + + Two + + + + Three + + + + Four + + +
+{% endexample %} + +### Tag addons + +{% example html wrapper=tags %} +
+ npm + +
+
+ npm + +
+
+ bundle + passing +
+ + CSS gzip size + 20.9 kB + +{% endexample %} \ No newline at end of file diff --git a/assets/scss/dashboard/_chips.scss b/assets/scss/dashboard/_chips.scss index 12643ab87..5ed5a6400 100644 --- a/assets/scss/dashboard/_chips.scss +++ b/assets/scss/dashboard/_chips.scss @@ -26,14 +26,14 @@ border-radius: 50%; } - .close { - cursor: pointer; - float: right; - font-size: 1.3rem; - padding-left: .5rem; - line-height: inherit; - margin-left: .25rem; - } + //.close { + // cursor: pointer; + // float: right; + // font-size: 1.3rem; + // padding-left: .5rem; + // line-height: inherit; + // margin-left: .25rem; + //} @at-root a#{&} { &:hover { diff --git a/assets/scss/dashboard/_tag.scss b/assets/scss/dashboard/_tag.scss index 7ac996ce2..10a08e750 100644 --- a/assets/scss/dashboard/_tag.scss +++ b/assets/scss/dashboard/_tag.scss @@ -1,12 +1,97 @@ .tag { - display: inline-block; font-size: px2rem(12px); color: $text-muted-dark; - background-color: rgba($text-muted-dark, .1); + background-color: $gray-200; border-radius: 3px; - padding: 2px 5px; - margin-right: 2px; - margin-top: 4px; - margin-bottom: 4px; + padding: 0 .5rem; + line-height: 2em; + display: inline-flex; cursor: default; -} \ No newline at end of file + font-weight: 400; + user-select: none; + + @at-root a#{&} { + text-decoration: none; + cursor: pointer; + transition: .3s color, .3s background; + + &:hover { + background-color: rgba($text-muted-dark, .20); + color: inherit; + } + } +} + +.tag-addon { + display: inline-block; + padding: 0 .5rem; + color: inherit; + text-decoration: none; + background: rgba(#000, .06); + margin: 0 -.5rem 0 .5rem; + text-align: center; + min-width: 1.5rem; + + &:last-child { + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; + } + + i { + vertical-align: middle; + margin: 0 -.25rem; + } + + @at-root a#{&} { + text-decoration: none; + cursor: pointer; + transition: .3s color, .3s background; + + &:hover { + background: rgba(#000, .16); + color: inherit; + } + } +} + +.tag-avatar { + width: 1.5rem; + height: 1.5rem; + border-radius: 3px 0 0 3px; + margin: 0 .5rem 0 -.5rem; +} + +@each $vendor, $color in $colors { + .tag-#{$vendor} { + background-color: $color; + color: #fff; + } +} + +@each $vendor, $color in $theme-colors { + .tag-#{$vendor} { + background-color: $color; + color: #fff; + } +} + +.tag-rounded { + border-radius: 50px; + + .tag-avatar { + border-radius: 50px; + } +} + +.tags { + margin-bottom: -.5rem; + font-size: 0; + + >.tag { + margin-bottom: .5rem; + + &:not(:last-child) { + margin-right: .5rem; + } + } +}