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

239 lines
4.2 KiB
SCSS
Raw Normal View History

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