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

refactor and fix styling #2357

Merged
merged 1 commit into from
Apr 6, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 21 additions & 2 deletions src/js/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export default {

...mapGetters({
themeClass: 'settings/themeClass',
backgroundClass: 'settings/backgroundClass',
useDashboardStyling: 'settings/useDashboardStyling',
useIndividualStyling: 'settings/useIndividualStyling',
useTranslucentPanels: 'settings/useTranslucentPanels',
Expand Down Expand Up @@ -112,6 +113,15 @@ export default {
}
},

backgroundClass(newValue, oldValue) {
if (oldValue) {
document.body.classList.remove(oldValue)
}
if (newValue) {
document.body.classList.add(newValue)
}
},

$route(to, from) {
if (this.$route.name === 'list') {
this.setFilter(this.$route.params.type)
Expand Down Expand Up @@ -251,15 +261,17 @@ export default {
}

// global areas settings
[class*='area__'] {
[class*=' area__'],
[class^='area__'] {
padding: 4px 0px;
background-color: var(--color-main-background);
border-radius: var(--border-radius);
min-width: 270px;
}

// special settings for header area
.area__header {
[class*=' area__header'],
[class^='area__header'] {
position: sticky;
top: 50px;
background-color: var(--color-main-background);
Expand All @@ -271,6 +283,13 @@ export default {
padding-left: 56px;
}

// [class*=' area__header_vote'],
// [class^='area__header_vote'] {
// background-color: transparent;
// border: none;
// box-shadow: none !important;
// }

// global modal settings
.modal__content {
padding: 14px;
Expand Down
231 changes: 126 additions & 105 deletions src/js/assets/scss/theming.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,157 +4,178 @@

// Theming styles

.page--scrolled {
#header::before {
margin-top: 0;
}
}

.dashboard--dark {
&:not(.dashboard--inverted) {
#header .logo {
filter: invert(1) hue-rotate(180deg) !important;
opacity: 1;
}

#appmenu {
svg {
filter: invert(1) hue-rotate(180deg) !important;
}


li:hover a::before,
li a.active::before,
li:hover a.active::before,
li a:focus::before {
display: none !important;
}
}

#appmenu .icon-more-white,
.header-right > div:not(#settings) {
filter: invert(1) hue-rotate(180deg);
}
}

#header {
--color-header: rgba(255, 255, 255, 1);
}
}

.theme--dark.dashboard--dark,
.theme--dark.polls--dark {
#app-navigation-vue .app-navigation-toggle svg {
filter: invert(1) hue-rotate(180deg) !important;
opacity: 1;
}

.poll-title,
.poll-list-title {
filter: invert(1) hue-rotate(180deg) !important;
}
}

.theme--light.polls--light {
#app-navigation-vue .app-navigation-toggle svg {
filter: invert(1) hue-rotate(180deg) !important;
opacity: 1;
}

.poll-title,
.poll-list-title {
filter: invert(1) hue-rotate(180deg) !important;
}
}

[class*='dashboard--'] {
@mixin translucentHeader {
// Transparent app menu header; Adopted from the dashboard
#header {
background: transparent !important;
--color-header: rgba(24, 24, 24, 1);

// --color-header: rgba(24, 24, 24, 1);
// Show gradient below navigation for visibility of icons when scrolled
&:before {
content: ' ';
display: block;
position: absolute;
background-image: linear-gradient(180deg, var(--color-header) 0%, transparent 100%);
background-image: linear-gradient(180deg, var(--color-header) 20%, transparent 100%);
width: 100%;
height: 70px;
height: 50px;
top: 0;
margin-top: -70px;
transition: margin-top var(--animation-slow);
}
}

.app-navigation {
border-radius: 0 var(--border-radius-large)
var(--border-radius-large) 0;
}

.app-sidebar {
border-radius: var(--border-radius-large) 0 0
var(--border-radius-large);
}

&.page--scrolled #header {
&:before {
&.page--scrolled {
#header::before {
margin-top: 0;
}
}
}

[class*='dashboard--'],
[class*='polls--'] {
@mixin roundedCorners {
// rounded corners for all app areas
.app-navigation {
border-right: 0px;
box-shadow: 2px 0 6px var(--color-box-shadow);
border-radius: 0 var(--border-radius-large) var(--border-radius-large) 0;
}

.app-content {
row-gap: 16px;
}

.vote_main {
row-gap: 16px;
.app-sidebar {
border-radius: var(--border-radius-large) 0 0 var(--border-radius-large);
}

[class*="area__"] {
[class*=" area__"],
[class^="area__"] {
padding: 8px;
margin: 0 0 0 0;
border-radius: var(--border-radius-large);
box-shadow: 2px 2px 6px var(--color-box-shadow);
}
}

@mixin flatAppHeader {
.area__header_vote {
box-shadow: none;
backdrop-filter: none !important;
border: none;
background-color: transparent !important;
transition: all var(--animation-slow) linear;
}
}

@mixin fixedAppHeader {
// fixes the app header, when page is scrolled horizontally
[class*=" area__header"],
[class^="area__header"] {
background-color: var(--color-main-background);
backdrop-filter: initial;
box-shadow: 6px 6px 6px var(--color-box-shadow);
margin-right: 0;
margin-left: -6px;
transition: all var(--animation-slow) linear;
}
}

@mixin tiledAreas {
// visually separated areas as tiles
.app-content {
padding: 0px 16px;
row-gap: 16px;
}

.area__header {
.vote_main {
row-gap: 16px;
}

[class*=" area__header"],
[class^="area__header"] {
top: 50px;
padding-left: 60px;
}


// empasize the action menu inside the app header
.poll-header-buttons {
align-self: flex-end;
border-radius: var(--border-radius-pill);
background-color: var(--color-main-background);
}
}

.translucent {
.app-navigation,
.app-sidebar,
.poll-header-buttons,
[class*="area__"] {
backdrop-filter: blur(10px);
background-color: var(--color-background-translucent);
@mixin translucentAreas {
// adds the translucent effect to the tiles
.app-navigation,
.app-sidebar,
.poll-header-buttons,
[class*=" area__"],
[class^="area__"] {
backdrop-filter: blur(10px);
background-color: var(--color-background-translucent);
}
}

@mixin headerDark {
#header {
--color-header: rgba(255, 255, 255, 1);
.header-left {
filter: invert(1) hue-rotate(180deg) !important;
#nextcloud {
opacity: 1;
}
}

.header-right {
.notifications,
.unified-search,
#contactsmenu {
filter: invert(1) hue-rotate(180deg) !important;
opacity: 1;
}
}
}
}

@mixin appHeaderDark {
.area__header_vote .bar_top_left,
.area__header_vote .header_bar_bottom,
.app-navigation-toggle {
filter: invert(1) hue-rotate(180deg) !important;
}
}

[class*='dashboard--'] {
@include roundedCorners();
@include tiledAreas();
@include translucentHeader();
@include translucentAreas();
&:not(.page--scrolled) {
@include flatAppHeader();
}
&.page--scrolled {
.area__header {
background-color: var(--color-main-background) !important;
backdrop-filter: initial !important;
box-shadow: 6px 6px 6px var(--color-box-shadow);
margin-right: 0;
margin-left: -6px;
transition: all .2s linear;
}
@include fixedAppHeader();
}
}

[class*='polls--'] {
@include roundedCorners();
@include tiledAreas();
.translucent {
@include translucentAreas();
}
&:not(.page--scrolled) {
@include flatAppHeader();
}
&.page--scrolled {
@include fixedAppHeader();
}
}

.dashboard--dark {
@include headerDark();
}

.theme--dark.dashboard--dark,
.polls--light {
&:not(.page--scrolled) {
@include appHeaderDark();
}
}
21 changes: 8 additions & 13 deletions src/js/components/Poll/PollHeaderButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@
<UserMenu />
<Popover>
<template #trigger>
<Actions>
<ActionButton icon="icon-mask-md-poll-information">
<template #icon>
<PollInformationIcon />
</template>
{{ t('polls', 'Poll informations') }}
</ActionButton>
</Actions>
<VueButton v-tooltip="t('polls', 'Poll informations')"
type="tertiary">
<PollInformationIcon />
</VueButton>
</template>
<PollInformation />
</Popover>
Expand All @@ -43,7 +39,7 @@

<script>
import { mapState } from 'vuex'
import { Actions, ActionButton, Popover } from '@nextcloud/vue'
import { Button as VueButton, Popover } from '@nextcloud/vue'
import { emit } from '@nextcloud/event-bus'
import ActionToggleSidebar from '../Actions/ActionToggleSidebar'
import UserMenu from '../User/UserMenu'
Expand All @@ -52,14 +48,13 @@ import PollInformationIcon from 'vue-material-design-icons/InformationOutline.vu
export default {
name: 'PollHeaderButtons',
components: {
ActionToggleSidebar,
PollInformationIcon,
Actions,
ActionButton,
Popover,
ActionToggleSidebar,
VueButton,
UserMenu,
ExportPoll: () => import('../Export/ExportPoll'),
PollInformation: () => import('../Poll/PollInformation'),
UserMenu,
},

computed: {
Expand Down