From d36f052062d3e80cb0ec4680a8636c3726be41df Mon Sep 17 00:00:00 2001 From: Yan Zhu Date: Wed, 30 Mar 2016 13:29:51 +0800 Subject: add badges code --- demo/index.html | 25 +++++++++++++++++++++++++ dist/spectre.css | 23 +++++++++++++++++++++++ spectre.less | 1 + src/badges.less | 25 +++++++++++++++++++++++++ 4 files changed, 74 insertions(+) create mode 100644 src/badges.less diff --git a/demo/index.html b/demo/index.html index f9c8ac2..5d642e5 100644 --- a/demo/index.html +++ b/demo/index.html @@ -500,6 +500,31 @@ +
+

badges

+
+
+ + Notifications + +
+
+ + Notifications + +
+
+ + Notifications + +
+
+ + Notifications + +
+
+
\ No newline at end of file diff --git a/dist/spectre.css b/dist/spectre.css index c902411..aed5fa6 100644 --- a/dist/spectre.css +++ b/dist/spectre.css @@ -1078,6 +1078,29 @@ textarea.form-input { font-size: 1.4rem; line-height: 1.8rem; } +.badge { + position: relative; + margin-right: 2.4rem; +} +.badge::after { + content: attr(data-badge); + color: #fff; + font-size: 1.2rem; + text-align: center; + line-height: 1.4rem; + background-color: #5764C6; + display: block; + width: 2rem; + height: 2rem; + padding: .3rem .1rem; + border-radius: 50%; + position: absolute; + top: -1rem; + right: -2.4rem; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} .toast { display: block; width: 100%; diff --git a/spectre.less b/spectre.less index d0b7a71..c5ebcf0 100644 --- a/spectre.less +++ b/spectre.less @@ -17,6 +17,7 @@ // Components @import 'src/labels.less'; +@import 'src/badges.less'; @import 'src/toasts.less'; @import 'src/menus.less'; @import 'src/navigation.less'; diff --git a/src/badges.less b/src/badges.less new file mode 100644 index 0000000..e0f1d46 --- /dev/null +++ b/src/badges.less @@ -0,0 +1,25 @@ +// Badges +.badge { + position: relative; + margin-right: 2.4rem; + + &::after { + content: attr(data-badge); + color: #fff; + font-size: 1.2rem; + text-align: center; + line-height: 1.4rem; + background-color: @core-color; + display: block; + width: 2rem; + height: 2rem; + padding: .3rem .1rem; + border-radius: 50%; + position: absolute; + top: -1rem; + right: -2.4rem; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } +} \ No newline at end of file -- cgit v1.3.1-26-gb76a