discourse/app/assets/stylesheets/common/components/badges.css.scss

247 lines
4.4 KiB
SCSS
Raw Normal View History

2013-02-06 03:16:51 +08:00
// --------------------------------------------------
// Badges
// --------------------------------------------------
// Base
// --------------------------------------------------
%badge {
display: inline-block;
font-weight: normal;
2013-02-06 03:16:51 +08:00
white-space: nowrap;
2013-08-02 18:46:36 +08:00
@include border-radius-all(10px);
2013-02-06 03:16:51 +08:00
}
// Category badge
// --------------------------------------------------
.badge-wrapper span {
font-size: 0.857em;
font-weight: bold;
white-space: nowrap;
display: inline-block;
line-height: 1;
position: relative;
2014-03-22 03:33:30 +08:00
}
2014-03-22 03:33:30 +08:00
.badge-wrapper {
white-space: nowrap;
position: relative;
display: inline-block;
}
.badge-category {
overflow: hidden;
text-overflow: ellipsis;
2015-01-29 14:34:05 +08:00
vertical-align: top;
2015-02-13 12:24:07 +08:00
.fa {
line-height: 0;
}
2015-01-29 14:34:05 +08:00
}
.badge-wrapper > .badge-category {
// ie9?
width: 100%;
2015-02-13 12:24:07 +08:00
padding: 5px 4px;
2015-01-29 14:34:05 +08:00
}
.d-header li.category .badge-wrapper {
max-width: calc(100% - 30px)
}
2015-01-29 14:38:18 +08:00
h3 .badge-category {
padding-left: 3px;
}
h3 .badge-wrapper {
padding-left: 4px;
}
2015-01-30 09:33:27 +08:00
header .title-wrapper {
.badge-category-bg, .badge-category {
vertical-align: middle;
}
.badge-category-bg {
padding-top:0;
padding-bottom:0;
}
}
.badge-category-parent-bg, .badge-category-bg {
2015-02-13 12:24:07 +08:00
padding: 5px 2px 4px 2px;
width: 2px;
.category-name {
display: none;
}
&:before {
content: "\a0";
}
2013-02-06 03:16:51 +08:00
}
.d-dropdown .badge-category {
&.restricted {
span {
display: inline-block;
margin: 0;
}
}}
h1 a.badge-category div {vertical-align: top;}
2015-01-29 14:34:05 +08:00
.category-breadcrumb li > .badge-category {
float: left;
&:not(.home):first-child {
.badge-category-bg {
display: none;
}
}
2015-01-29 14:34:05 +08:00
}
.user-preferences .autocomplete .badge-wrapper .badge-category {
margin: 2px;
font-weight: normal;
}
.user-preferences .autocomplete .selected .badge-wrapper .badge-category {
font-weight: bold;
}
.ac-wrap {
.badge-wrapper span {
padding-top: 3px;
padding-bottom: 0;
height: 20px;
max-width: 200px;
}
}
// specific styles for badge categories
2015-01-30 14:57:46 +08:00
.bar .badge-category {
color: $primary !important;
2015-01-30 14:57:46 +08:00
}
2015-01-30 16:17:26 +08:00
header .title-wrapper .bar .badge-category {
2015-01-30 14:57:46 +08:00
color: $header-primary !important;
}
2015-01-29 14:34:05 +08:00
.category-breadcrumb li.bar > .badge-category {
background: dark-light-diff($primary, $secondary, 95%, -65%) !important;
2015-02-22 11:02:08 +08:00
line-height: 24px;
2015-01-29 14:34:05 +08:00
&:not(.home):first-child {
border-left-width: 5px;
border-left-style: solid;
}
}
2015-02-25 14:42:10 +08:00
.category-breadcrumb .box > a.badge-category {
margin-bottom: 0;
height: 24px;
// TODO clean this up
padding-top: 6px !important;
padding-bottom: 0 !important;
}
2015-01-29 14:48:55 +08:00
.category-dropdown-menu .cat .badge-wrapper.box {
width: 110%;
}
.badge-wrapper.box {
.badge-category-bg {
position: absolute;
padding: 0;
width: 100%;
height: 100%;
}
2015-01-29 14:48:55 +08:00
> .badge-category {
width: 100%;
2015-02-13 12:24:07 +08:00
box-sizing: border-box;
padding: 5px 6px 4px 6px;
2015-01-29 14:48:55 +08:00
}
}
2015-01-29 14:48:55 +08:00
.title-wrapper .badge-wrapper.box .badge-category {
vertical-align: middle;
}
2013-02-06 03:16:51 +08:00
// Notification badge
// --------------------------------------------------
.badge-notification {
@extend %badge;
2015-02-09 07:09:12 +08:00
padding: 4px 5px 2px 5px;
2014-09-04 12:02:29 +08:00
vertical-align: middle;
2014-07-26 11:06:14 +08:00
color: $secondary;
2013-02-06 03:16:51 +08:00
font-size: 11px;
2014-03-13 11:17:18 +08:00
line-height: 1;
2013-08-03 03:41:02 +08:00
text-align: center;
2014-07-26 11:06:14 +08:00
background-color: scale-color($primary, $lightness: 70%);
2013-02-06 03:16:51 +08:00
&[href] {
2014-07-26 11:06:14 +08:00
color: $secondary;
2013-02-06 03:16:51 +08:00
}
// New posts
2013-02-06 03:16:51 +08:00
&.new-posts, &.unread-posts {
2014-07-26 11:06:14 +08:00
background-color: scale-color($tertiary, $lightness: 50%);
color: $secondary;
font-weight: normal;
2013-02-06 03:16:51 +08:00
}
&.new-topic {
background-color: transparent;
2014-09-04 04:33:56 +08:00
color: scale-color($tertiary, $lightness: 20%);
font-weight: normal;
font-size: 0.929em;
}
2014-09-04 04:33:56 +08:00
&.new-topic::before {
2014-09-04 09:07:15 +08:00
content: "";
margin-right: 2px;
2014-09-04 04:33:56 +08:00
}
2013-02-06 03:16:51 +08:00
// Click count
&.clicks {
font-weight: normal;
background-color: #ddd;
top: -1px;
2013-11-18 11:32:58 +08:00
color: #888;
position: relative;
margin-left: 2px;
2014-07-26 00:22:55 +08:00
border: none;
2013-02-06 03:16:51 +08:00
}
}
// Posts badge
// --------------------------------------------------
.badge-posts {
font-weight: normal;
font-size: 1em;
2013-02-06 03:16:51 +08:00
line-height: 1;
&[href] {
color: scale-color($primary, $lightness: 40%);
2013-02-06 03:16:51 +08:00
}
}
// Group badge
// --------------------------------------------------
.badge-group {
@extend %badge;
2015-02-09 07:09:12 +08:00
padding: 4px 5px 2px 5px;
color: $primary;
text-shadow: 0 1px 0 rgba($primary, 0.1);
2014-08-06 21:31:13 +08:00
background-color: dark-light-diff($primary, $secondary, 90%, -65%);
border-color: dark-light-diff($primary, $secondary, 90%, -65%);
font-size: 0.857em;
box-shadow: inset 0 1px 0 rgba(0,0,0, 0.22);
}