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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

151 lines
3.0 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;
2018-07-13 04:38:51 +08:00
border-radius: 10px;
2013-02-06 03:16:51 +08:00
}
2015-03-05 11:15:21 +08:00
// Category badges
2013-02-06 03:16:51 +08:00
// --------------------------------------------------
.badge-category__wrapper {
color: var(--primary-high);
overflow: hidden;
text-overflow: ellipsis;
font-size: var(--font-down-1);
white-space: nowrap;
position: relative;
display: inline-flex;
align-items: baseline;
.badge-category {
display: inline-flex;
align-items: baseline;
gap: 0.33em;
color: var(--primary-high);
min-width: 0;
&:before {
content: "";
background: var(--category-badge-color);
flex: 0 0 auto;
width: 0.625rem; // fixed dimensions (10px square)
height: 0.625rem;
}
2015-03-10 00:25:27 +08:00
&__name {
color: currentColor;
text-overflow: ellipsis;
overflow: hidden;
min-width: 0;
}
&.--has-parent {
&:before {
background: linear-gradient(
90deg,
var(--parent-category-badge-color) 50%,
var(--category-badge-color) 50%
);
2015-03-05 11:15:21 +08:00
}
}
2015-01-30 14:57:46 +08:00
.extra-info-wrapper & {
color: var(--header_primary-high);
}
}
.d-icon {
width: 0.74em;
height: 0.74em;
color: var(--primary-medium);
2015-01-29 14:48:55 +08:00
}
}
2013-02-06 03:16:51 +08:00
// Notification badge
// --------------------------------------------------
.badge-notification {
@extend %badge;
position: relative;
top: -2px;
2019-01-18 04:46:55 +08:00
padding: 0.21em 0.42em;
min-width: 0.5em;
color: var(--secondary);
font-size: var(--font-down-2);
line-height: var(--line-height-small);
2013-08-03 03:41:02 +08:00
text-align: center;
background-color: var(--primary-low-mid-or-secondary-low);
2013-02-06 03:16:51 +08:00
&[href] {
color: var(--secondary);
2013-02-06 03:16:51 +08:00
}
&:hover {
color: var(--secondary);
}
// Unread posts
2013-02-06 03:16:51 +08:00
&.unread-posts {
background-color: var(--tertiary-med-or-tertiary);
color: var(--secondary);
2015-08-19 03:28:58 +08:00
font-weight: dark-light-choose(normal, bold);
2013-02-06 03:16:51 +08:00
}
&.new-topic {
background-color: transparent;
padding-left: 0.15em;
}
2014-09-04 04:33:56 +08:00
&.new-topic::before {
content: "";
background: var(--tertiary-med-or-tertiary);
display: inline-block;
height: 8px;
width: 8px;
border-radius: 50%;
2014-09-04 04:33:56 +08:00
}
2013-02-06 03:16:51 +08:00
// Click count
&.clicks {
font-weight: normal;
background-color: var(--primary-low);
top: -1px;
color: var(--primary-medium);
2013-11-18 11:32:58 +08:00
position: relative;
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: var(--font-0);
line-height: var(--line-height-small);
2013-02-06 03:16:51 +08:00
&[href] {
color: var(--primary-med-or-secondary-med);
2013-02-06 03:16:51 +08:00
}
}
// Group badge
// --------------------------------------------------
.badge-group {
@extend %badge;
padding: 2px 5px;
color: var(--primary);
background-color: var(--primary-low);
border-color: var(--primary-low);
font-size: var(--font-down-1);
}