Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
55 changes: 50 additions & 5 deletions src/assets/NcAppNavigationItem.scss
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

When using real images for the icons the styles are now wrong with 34 as the background is no longer primary the color should not be inverted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,42 @@
}
}

// When .active class is applied, change color background of link and utils. The
// !important prevents the focus state to override the active state.
&.active {
// !important so :focus-within does not override the active state.
// New design (NC34+): glassy tinted bg + inline-start stripe.
&:not(.app-navigation-entry--legacy).active {
background-color: var(--color-primary-element-light) !important;

&:hover {
Comment thread
nfebe marked this conversation as resolved.
background-color: var(--color-primary-element-light-hover) !important;
}

&:not(.app-navigation-entry--editing) {
.app-navigation-entry-link,
.app-navigation-entry-button {
color: var(--color-main-text) !important;
}
}

&:not(.app-navigation-entry--editing)::before {
Comment thread
nfebe marked this conversation as resolved.
content: '';
position: absolute;
inset-block: calc(var(--default-grid-baseline, 4px) * 2);
inset-inline-start: 0;
width: 3px;
background-color: var(--color-primary-element);
border-radius: 999px;
animation: nc-nav-stripe-in var(--animation-quick, 200ms) ease-out;
}
}

// Legacy design (NC < 34): solid primary fill.
&.app-navigation-entry--legacy.active {
background-color: var(--color-primary-element) !important;

&:hover {
background-color: var(--color-primary-element-hover) !important;
}

// overwrite active text color
.app-navigation-entry-link, .app-navigation-entry-button {
color: var(--color-primary-element-text) !important;
}
Expand All @@ -46,6 +72,10 @@
&:hover {
background-color: var(--color-background-hover);
}
&:not(.app-navigation-entry--legacy):focus-within,
&:not(.app-navigation-entry--legacy):hover {
background-color: color-mix(in srgb, var(--color-primary-element) 8%, transparent);
}
&.active,
&:focus-within,
&:hover {
Expand All @@ -71,7 +101,10 @@
.app-navigation-entry__actions:hover :deep(.button-vue) {
background-color: var(--color-background-dark) !important;
}
&.active .app-navigation-entry__actions:hover :deep(.button-vue) {
&:not(.app-navigation-entry--legacy).active .app-navigation-entry__actions:hover :deep(.button-vue) {
background-color: var(--color-background-dark) !important;
}
&.app-navigation-entry--legacy.active .app-navigation-entry__actions:hover :deep(.button-vue) {
background-color: var(--color-primary-element) !important;
}

Expand All @@ -97,6 +130,7 @@
padding: 0;
white-space: nowrap;
color: var(--color-main-text);
font-weight: 500;
background-repeat: no-repeat;
background-position: $icon-margin center;
background-size: $icon-size $icon-size;
Expand Down Expand Up @@ -228,3 +262,14 @@
}
}
}

@keyframes nc-nav-stripe-in {
from {
transform: scaleY(0);
opacity: 0;
}
to {
transform: scaleY(1);
opacity: 1;
}
}
17 changes: 13 additions & 4 deletions src/components/NcAppNavigation/NcAppNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ import NcAppNavigationList from '../NcAppNavigationList/NcAppNavigationList.vue'
import NcAppNavigationToggle from './NcAppNavigationToggle.vue'
import { useIsMobile } from '../../composables/useIsMobile/index.ts'
import { getTrapStack } from '../../utils/focusTrap.ts'
import { isLegacy34 } from '../../utils/legacy.ts'
import { HAS_APP_NAVIGATION_KEY } from '../NcContent/constants.ts'

const props = defineProps<{
Expand Down Expand Up @@ -296,7 +297,10 @@ function handleEsc(): void {
<div
ref="appNavigationContainer"
class="app-navigation"
:class="{ 'app-navigation--closed': !open }">
:class="{
'app-navigation--closed': !open,
'app-navigation--legacy': isLegacy34,
}">
<nav
id="app-navigation-vue"
:aria-hidden="open ? 'false' : 'true'"
Expand Down Expand Up @@ -354,9 +358,14 @@ function handleEsc(): void {
user-select: none;
flex-grow: 0;
flex-shrink: 0;
background-color: var(--color-main-background-blur, var(--color-main-background));
-webkit-backdrop-filter: var(--filter-background-blur, none);
backdrop-filter: var(--filter-background-blur, none);
// New design (NC34+): transparent so the frosted chrome on NcContent shows through.
background-color: transparent;

&--legacy {
background-color: var(--color-main-background-blur, var(--color-main-background));
-webkit-backdrop-filter: var(--filter-background-blur, none);
backdrop-filter: var(--filter-background-blur, none);
}

&--closed {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the settings app in server

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But proper fix is to fix the settings app: nextcloud/server#60236

margin-inline-start: calc(-1 * min($navigation-width, var(--app-navigation-max-width)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'icon-collapse--open': open,
}"
:aria-label="labelButton"
:variant="active ? 'tertiary-on-primary' : 'tertiary'"
:variant="(active && isLegacy34) ? 'tertiary-on-primary' : 'tertiary'"
@click="onClick">
<template #icon>
<ChevronUp
Expand All @@ -29,6 +29,7 @@
import ChevronDown from 'vue-material-design-icons/ChevronDown.vue'
import ChevronUp from 'vue-material-design-icons/ChevronUp.vue'
import { t } from '../../l10n.ts'
import { isLegacy34 } from '../../utils/legacy.ts'
import NcButton from '../NcButton/index.ts'

export default {
Expand All @@ -40,6 +41,10 @@ export default {
ChevronUp,
},

setup() {
return { isLegacy34 }
},

props: {
/**
* Is the list currently open (or collapsed)
Expand Down
5 changes: 4 additions & 1 deletion src/components/NcAppNavigationItem/NcAppNavigationItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ Just set the `pinned` prop.
:class="{
'app-navigation-entry--editing': editingActive,
'app-navigation-entry--deleted': undo,
'app-navigation-entry--legacy': isLegacy34,
active: (to && isActive) || active,
}">
<!-- Icon and name -->
Expand Down Expand Up @@ -391,7 +392,7 @@ Just set the `pinned` prop.
:open="menuOpen"
:forceMenu="forceMenu"
:defaultIcon="menuIcon"
:variant="(to && isActive) || active ? 'tertiary-on-primary' : 'tertiary'"
variant="tertiary"
@update:open="onMenuToggle">
<template #icon>
<!-- @slot Slot for the custom menu icon -->
Expand Down Expand Up @@ -444,6 +445,7 @@ import NcInputConfirmCancel from './NcInputConfirmCancel.vue'
import { useIsMobile } from '../../composables/useIsMobile/index.js'
import { t } from '../../l10n.ts'
import { createElementId } from '../../utils/createElementId.ts'
import { isLegacy34 } from '../../utils/legacy.ts'
import NcActionButton from '../NcActionButton/index.js'
import NcActions from '../NcActions/index.js'
import NcLoadingIcon from '../NcLoadingIcon/index.ts'
Expand Down Expand Up @@ -663,6 +665,7 @@ export default {
setup() {
return {
isMobile: useIsMobile(),
isLegacy34,
}
},

Expand Down
27 changes: 26 additions & 1 deletion src/components/NcAppNavigationItem/NcInputConfirmCancel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</docs>

<template>
<div class="app-navigation-input-confirm">
<div class="app-navigation-input-confirm" :class="{ 'app-navigation-input-confirm--legacy': isLegacy34 }">
<form
@submit.prevent="confirm"
@keydown.esc.exact.stop.prevent="cancel"
Expand Down Expand Up @@ -51,6 +51,7 @@
import IconArrowRight from 'vue-material-design-icons/ArrowRight.vue'
import IconClose from 'vue-material-design-icons/Close.vue'
import { t } from '../../l10n.ts'
import { isLegacy34 } from '../../utils/legacy.ts'
import NcButton from '../NcButton/index.js'

export default {
Expand All @@ -62,6 +63,10 @@ export default {
NcButton,
},

setup() {
return { isLegacy34 }
},

props: {
/**
* If this element is used on a primary element set to true for primary styling.
Expand Down Expand Up @@ -156,5 +161,25 @@ $input-margin: 5px;
border-color: var(--color-primary-element);
}
}

// New design (NC34+): square confirm/cancel buttons with consistent gaps.
&:not(&--legacy) {
form {
align-items: center;
gap: $input-margin;
padding-inline-end: $input-margin;
}

.app-navigation-input-confirm__input {
margin-inline-end: 0 !important;
}

:deep(.button-vue) {
width: $input-height !important;
min-width: $input-height !important;
height: $input-height !important;
flex: 0 0 $input-height;
}
}
}
</style>
9 changes: 8 additions & 1 deletion src/components/NcButton/NcButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ import type { RouteLocationRaw } from 'vue-router'

import { computed, inject } from 'vue'
import { routerKey } from 'vue-router'
import { isLegacy } from '../../utils/legacy.ts'
import { isLegacy, isLegacy34 } from '../../utils/legacy.ts'
import { useNcFormBox } from '../NcFormBox/useNcFormBox.ts'

export type ButtonAlignment = 'start'
Expand Down Expand Up @@ -699,6 +699,7 @@ function onClick(event: MouseEvent) {
[`button-vue--${flexAlignment}`]: flexAlignment !== 'center',
'button-vue--reverse': isReverseAligned,
'button-vue--legacy': isLegacy,
'button-vue--legacy34': isLegacy34,
},
formBoxItemClass,
]"
Expand Down Expand Up @@ -931,6 +932,12 @@ function onClick(event: MouseEvent) {
}
}

&--tertiary:not(#{&}--legacy34) {
&:hover:not(:disabled) {
background-color: color-mix(in srgb, var(--color-primary-element) 8%, transparent);
}
}

// Tertiary, no background
&--tertiary-no-background {
&:hover:not(:disabled) {
Expand Down
23 changes: 22 additions & 1 deletion src/components/NcContent/NcContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import NcButton from '../NcButton/NcButton.vue'
import NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'
import { useIsMobile } from '../../composables/useIsMobile/index.js'
import { t } from '../../l10n.ts'
import { isLegacy34 } from '../../utils/legacy.ts'
import { CONTENT_SELECTOR_KEY, HAS_APP_NAVIGATION_KEY } from './constants.ts'
import contentSvg from './content-selected.svg?raw'
import navigationSvg from './navigation-selected.svg?raw'
Expand Down Expand Up @@ -145,7 +146,10 @@ function setAppNavigation(value: boolean): void {
</script>

<template>
<div id="content-vue" class="content" :class="`app-${appName.toLowerCase()}`">
<div
id="content-vue"
class="content"
:class="[`app-${appName.toLowerCase()}`, { 'content--legacy': isLegacy34 }]">
<Teleport to="#skip-actions">
<div class="vue-skip-actions__container">
<div class="vue-skip-actions__headline">
Expand Down Expand Up @@ -190,6 +194,15 @@ function setAppNavigation(value: boolean): void {
padding: var(--body-container-margin)!important;
backdrop-filter: brightness(50%);
}

// New design (NC34+): divider only when an open navigation is present.
@media only screen and (min-width: $breakpoint-mobile) {
.content:not(.content--legacy) .app-navigation:not(.app-navigation--closed):not(.app-navigation--close) ~ .app-content {
border-inline-start: 1px solid var(--color-border);
border-start-start-radius: var(--body-container-radius);
border-end-start-radius: var(--body-container-radius);
}
}
</style>

<style lang="scss" scoped>
Expand Down Expand Up @@ -236,6 +249,14 @@ function setAppNavigation(value: boolean): void {
overflow: hidden;
padding: 0;

// New design (NC34+): wrapper carries the frosted chrome so nav and
// AppContent rounded-edge cutouts share one surface.
&:not(&--legacy) {
background-color: var(--color-main-background-blur, var(--color-main-background));
backdrop-filter: var(--filter-background-blur, none);
-webkit-backdrop-filter: var(--filter-background-blur, none);
}

&:not(.with-sidebar--full) {
position: fixed;
}
Expand Down
Loading
Loading