discourse/app/assets/stylesheets/common/base/header.scss

Failed to ignore revisions in .git-blame-ignore-revs.

375 lines
6.9 KiB
SCSS
Raw Normal View History

.d-header {
display: flex;
align-items: center;
2017-09-06 22:47:48 +08:00
width: 100%;
position: absolute;
top: 0;
z-index: z("header");
2017-09-06 22:47:48 +08:00
background-color: $header_background;
box-shadow: shadow("header");
2017-09-06 22:47:48 +08:00
> .wrap {
width: calc(100% - 16px); // accommodates for 8px vertical padding
height: 100%;
.contents {
display: flex;
align-items: center;
height: 100%;
.header-row {
width: 100%;
.logo-wrapper {
float: left;
}
.auth-buttons {
float: right;
margin-top: 0.4em;
.login-button,
.signup-button {
padding: 8px 14px;
}
}
}
}
}
2017-09-06 22:47:48 +08:00
.docked & {
position: fixed;
backface-visibility: hidden; /** do magic for scrolling performance **/
2017-09-06 22:47:48 +08:00
}
.title {
display: flex;
align-items: center;
height: 100%;
a,
a:visited {
2017-09-06 22:47:48 +08:00
color: $header_primary;
}
2017-09-06 22:47:48 +08:00
}
#site-logo {
width: auto;
2017-09-06 22:47:48 +08:00
}
.d-icon-home {
font-size: $font-up-6;
2017-09-06 22:47:48 +08:00
}
.panel {
position: relative;
display: flex;
flex: 0 0 auto;
margin-left: auto;
align-items: center;
2017-09-06 22:47:48 +08:00
}
.hamburger-panel,
.user-menu,
.search-menu {
width: 0; // Flexbox fix for Safari
}
2018-02-17 06:13:10 +08:00
.header-buttons {
display: flex;
align-items: center;
margin-top: 0.2em;
2018-02-17 06:13:10 +08:00
}
.login-button,
.sign-up-button {
2017-09-06 22:47:48 +08:00
padding: 6px 10px;
.fa {
margin-right: 3px;
}
2017-09-06 22:47:48 +08:00
}
.login-button {
2017-09-06 22:47:48 +08:00
margin-left: 7px;
}
2017-09-06 23:29:43 +08:00
}
2017-09-06 22:47:48 +08:00
.header-dropdown-toggle,
.drop-down,
.panel-body {
.flagged-posts,
.reviewables {
2017-09-11 02:26:55 +08:00
background: $danger;
2018-02-21 06:31:02 +08:00
min-width: 6px;
2017-09-11 02:26:55 +08:00
}
}
2017-09-06 23:29:43 +08:00
.d-header-icons {
text-align: center;
margin: 0 0 0 5px;
list-style: none;
> li {
float: left;
}
.icon {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 2.2857em;
height: 2.2857em;
padding: 0.2143em;
2017-09-06 23:29:43 +08:00
text-decoration: none;
cursor: pointer;
border-top: 1px solid transparent;
border-left: 1px solid transparent;
border-right: 1px solid transparent;
transition: all linear 0.15s;
outline: none;
img.avatar {
width: 2.1333em;
height: 2.1333em;
}
&:hover,
&:focus {
background-color: $primary-low;
2017-09-06 22:47:48 +08:00
border-top: 1px solid transparent;
border-left: 1px solid transparent;
border-right: 1px solid transparent;
2019-02-01 08:31:09 +08:00
.d-icon {
color: $primary-medium;
}
2017-09-06 23:29:43 +08:00
}
&:active {
color: $primary;
background-color: $primary-low;
}
}
.drop-down-mode & {
2017-09-06 23:29:43 +08:00
.active .icon {
position: relative;
background-color: $secondary;
cursor: default;
border-top: 1px solid $primary-low;
border-left: 1px solid $primary-low;
border-right: 1px solid $primary-low;
.d-icon {
color: $primary-medium;
}
2017-09-06 23:29:43 +08:00
&:after {
display: block;
position: absolute;
top: 100%;
left: 0;
z-index: z("header") + 1; // Higher than .menu-panel
2017-09-06 23:29:43 +08:00
width: 100%;
height: 0;
content: "";
border-top: 1px solid $secondary;
2017-09-06 22:47:48 +08:00
}
2017-09-06 23:29:43 +08:00
&:hover {
border-bottom: none;
}
2017-09-06 22:47:48 +08:00
}
2017-09-06 23:29:43 +08:00
}
2017-09-06 23:29:43 +08:00
.d-icon {
width: 100%;
2018-01-13 06:27:38 +08:00
font-size: $font-up-4;
line-height: $line-height-large;
2017-09-06 23:29:43 +08:00
display: inline-block;
color: $header_primary-low-mid;
2017-09-06 22:47:48 +08:00
}
2017-09-06 23:29:43 +08:00
.notifications {
position: relative;
}
.ring {
position: absolute;
top: -9px;
z-index: z("base");
2017-09-06 23:29:43 +08:00
margin-left: 0;
}
.header-dropdown-toggle {
position: relative;
}
.badge-notification {
position: absolute;
z-index: z("base");
2017-09-06 23:29:43 +08:00
left: 0;
2018-01-13 06:27:38 +08:00
top: -4px;
2019-01-18 04:46:55 +08:00
min-width: 0.6em;
2017-09-06 23:29:43 +08:00
}
.unread-notifications {
left: auto;
2018-01-13 06:27:38 +08:00
right: -3px;
2017-10-11 04:07:46 +08:00
background-color: dark-light-choose($tertiary-medium, $tertiary);
2017-09-06 23:29:43 +08:00
}
.unread-high-priority-notifications,
.ring {
2017-09-06 23:29:43 +08:00
left: auto;
right: 25px;
2017-09-06 22:47:48 +08:00
}
}
.highlight-strong {
2017-06-12 10:20:14 +08:00
background-color: $highlight-medium;
}
.search-highlight {
font-weight: bold;
}
2014-10-18 15:12:48 +08:00
#search-help table td {
padding-right: 10px;
}
2014-11-10 18:31:15 +08:00
// we don't need this X to clear field
#search-term::-ms-clear {
display: none;
}
// topic info in the header
.extra-info-wrapper {
display: flex;
align-items: center;
height: 100%;
line-height: $line-height-medium;
padding: 0 1.5em 0 0.5em;
// we need to hide overflow in both to truncate the title in a flexbox
overflow: hidden;
.extra-info {
overflow: hidden;
width: 100%;
-webkit-animation: fadein 0.5s;
animation: fadein 0.5s;
}
.topic-link {
color: $header_primary;
display: block;
@include ellipsis;
}
.topic-statuses {
.d-icon {
color: $header_primary-medium;
}
.d-icon-envelope {
color: $danger;
}
}
.header-title {
2020-05-05 07:40:51 +08:00
// bottom margin here is very fragile, causes tag misalignment
margin: 0 0 0.15em 0;
.archetype-private_message & {
// PMs might have participant avatars in the header
margin: 0;
}
font-size: $font-up-3;
width: 100%;
}
.categories-wrapper {
display: inline-flex;
2019-08-28 16:52:46 +08:00
align-items: center;
// Protection against a very rare edge case in mobile header for topics with
// very long category names and lots of tags at the same time
max-width: 80%;
flex: 0 1 auto;
min-width: 1px;
.badge-wrapper {
@include ellipsis;
}
}
.badge-wrapper {
margin-right: 8px;
}
.badge-wrapper.bullet {
.badge-category-parent-bg,
.badge-category-bg {
min-width: 5px;
}
}
2018-12-08 09:01:38 +08:00
.badge-wrapper {
&.bullet,
&.bar,
&.none {
span.badge-category {
color: $header_primary-high;
}
}
}
.topic-header-extra {
display: inline-flex;
align-items: center;
max-width: 100%;
.discourse-tags {
2018-12-08 09:01:38 +08:00
color: $header_primary-high;
@include ellipsis;
.discourse-tag {
display: inline; // tags need to stay inline in order for them to truncate
}
}
}
}
// PM header participants
$avatar-height: 1.641em;
$mobile-avatar-height: 1.532em;
.topic-header-participants {
display: flex;
align-items: center;
overflow: hidden;
font-size: $font-down-1;
&:not(:first-child) {
margin-left: 5px;
}
.trigger-user-card,
.trigger-group-card {
&:not(:last-of-type) {
margin-right: 5px;
}
}
.trigger-user-card {
.icon {
height: $avatar-height;
.mobile-view & {
height: $mobile-avatar-height;
}
display: inline-block;
img {
height: 100%;
width: auto;
}
}
}
.trigger-group-card {
padding: 0 5px;
border: 1px solid $primary-low;
border-radius: 0.25em;
@include ellipsis;
.icon {
display: flex;
align-items: center;
height: $avatar-height;
.mobile-view & {
height: $mobile-avatar-height;
}
color: $primary-high;
.d-icon {
margin-right: 5px;
}
}
span {
@include ellipsis;
}
}
.more-participants {
color: $header_primary-high;
margin-left: 5px;
}
}