Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header style adaptation for v28 #330

Merged
merged 2 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions css/components/ncheadermenu.scss
Original file line number Diff line number Diff line change
@@ -1,51 +1,10 @@
@import '../variables';

#header {

box-shadow: 0 2px 9px var(--color-box-shadow);

.header-right {

.header-menu {

&__trigger {
opacity: 1;
width: 48px;

@media screen and (max-width: $breakpoint-mobile) {
& > span {
display: none;
}
}

// hover effect for function entries
&:hover {

span {
color: var(--color-primary-hover);
}

&:not([aria-expanded="true"]) {

&::before {
background-color: var(--color-primary);
border-radius: 0;
bottom: 0;
content: " ";
display: block;
height: 4px;
left: 50%;
opacity: 1;
pointer-events: none;
position: fixed;
bottom: 8px;
transform: translateX(-50%);
width: 100%;
}
}
}
}

// reposition flyout menus
&__wrapper {
background-color: var(--telekom-color-background-surface);
Expand Down
108 changes: 75 additions & 33 deletions css/layouts/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ header {
}
}

@mixin color-icon {
filter: brightness(0) saturate(100%) invert(13%) sepia(85%) saturate(6096%) hue-rotate(321deg) brightness(75%) contrast(104%) !important;
}

// main header styles
#body-user #header,
#body-settings #header,
Expand Down Expand Up @@ -121,43 +117,95 @@ header {
display: none;
}

.header-menu__trigger {
font-size: 12px;
font-weight: normal;
}
#header {
box-shadow: 0 2px 9px var(--color-box-shadow);
.header-right {
// hide 'Search contacts' button
#contactsmenu {
display: none;
}

#unified-search {
// general styling for buttons in the header
.header-menu {
width: auto;
button.button-vue {
width: auto !important;
padding-left: 0;
.button-vue__label {
font-size: 12px;
font-weight: normal;
}

.header-menu__trigger {
background-image: var(--icon-search);
background-size: auto 24px;
background-position: center;
background-repeat: no-repeat;
.button-vue__wrapper {
width: 44px;
.button-vue__icon {
background-size: auto 24px;
background-position: center;
background-repeat: no-repeat;
svg {
display: none;
}
}
}

&:hover {
&::before {
background-color: var(--color-primary);
content: " ";
display: block;
height: 4px;
bottom: 8px;
width: 100%;
position: absolute;
}

.button-vue__label {
color: var(--color-primary);
cursor: pointer;
}

.button-vue__icon {
filter: var(--nmc-color-icon) !important;
}
}

&:hover {
filter: var(--nmc-color-icon)
@media screen and (max-width: $breakpoint-mobile) {
padding-right: 0;
.button-vue__label {
display: none;
}
}
}
}
}
}

.unified-search__trigger {
display: none;
// Custom styling for the 'Search' button
#header .header-right .header-menu:not(.user-menu) {
button.unified-search__button {
border: none;
border-radius: 0;
height: 100%;
.button-vue__wrapper {
.button-vue__icon {
background-image: var(--icon-search-dark);
}
}

}
}

// Custom styling for the 'User' button
#user-menu {

@media screen and (max-width: $breakpoint-mobile) {
margin-right: var(--telekom-spacing-composition-space-03);
}

.header-menu__trigger {
background-image: var(--icon-user);
background-size: auto 24px;
background-position: center;
background-repeat: no-repeat;

&:hover {
filter: var(--nmc-color-icon)
button.header-menu__trigger {
.button-vue__wrapper {
.button-vue__icon {
background-image: var(--icon-user);
}
}
}

Expand All @@ -169,12 +217,6 @@ header {
.header-menu__content {
width: 350px !important;
}

.user-menu__nav {
ul {
width: 100%;
}
}
}

// styles for public share pages
Expand Down
1 change: 0 additions & 1 deletion css/nmcstyle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,4 @@

/* v25 override */
@import 'v25/ncappnavigation.scss';
@import 'v25/header.scss';

57 changes: 0 additions & 57 deletions css/v25/header.scss

This file was deleted.

18 changes: 12 additions & 6 deletions src/nmcheader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,32 @@
const head = document.querySelector('head')
if (head !== null) {
const user = head.attributes['data-user-displayname'].value

const menuButton = document.querySelector('#user-menu > a')
const menuButton = document.querySelector('#user-menu > button')
if (menuButton !== null) {
menuButton.innerHTML = '<span>' + user + '</span>'
const username = document.createElement('span')
username.className="button-vue__label"

Check failure on line 32 in src/nmcheader.ts

View workflow job for this annotation

GitHub Actions / eslint

Operator '=' must be spaced

Check failure on line 32 in src/nmcheader.ts

View workflow job for this annotation

GitHub Actions / eslint

Strings must use singlequote
username.innerText = user
menuButton.appendChild(username)
}
}

const searchButton = document.querySelector('#unified-search > a')
const searchButton = document.querySelector('button.unified-search__button')
if (searchButton !== null) {
searchButton.innerHTML = '<span>' + t(app, 'Search') + '</span>'
const searchlabel = document.createElement('span')
searchlabel.className="button-vue__label"

Check failure on line 41 in src/nmcheader.ts

View workflow job for this annotation

GitHub Actions / eslint

Operator '=' must be spaced

Check failure on line 41 in src/nmcheader.ts

View workflow job for this annotation

GitHub Actions / eslint

Strings must use singlequote
searchlabel.innerText = t(app, 'Search')
searchButton.appendChild(searchlabel)
}

const menuElements = document.createElement('div')
menuElements.id = 'nmcsettings-menu'

const userMenu = document.querySelector('nav.user-menu__nav ul')
const userMenu = document.querySelector('#header-menu-user-menu .header-menu__content ul')
if (userMenu !== null) {
userMenu.prepend(menuElements)
}

// @ts-ignore

Check failure on line 54 in src/nmcheader.ts

View workflow job for this annotation

GitHub Actions / eslint

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free
const View = Vue.extend(UserMenu)
new View({ propsData: { menuItems } }).$mount('#nmcsettings-menu')
})
Loading