Skip to content

Commit

Permalink
fix(theming): change color button contrast on admin settings
Browse files Browse the repository at this point in the history
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
  • Loading branch information
ShGKme authored and backportbot[bot] committed Feb 5, 2024
1 parent d36f846 commit b025ee0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 29 deletions.
1 change: 0 additions & 1 deletion apps/theming/src/AdminTheming.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
:default-value="colorPickerField.defaultValue"
:display-name="colorPickerField.displayName"
:value.sync="colorPickerField.value"
data-admin-theming-setting-primary-color
@update:theming="$emit('update:theming')" />

<!-- Default background picker -->
Expand Down
42 changes: 14 additions & 28 deletions apps/theming/src/components/admin/ColorPickerField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@
<div class="field__row">
<NcColorPicker :value.sync="localValue"
:advanced-fields="true"
data-admin-theming-setting-primary-color-picker
@update:value="debounceSave">
<NcButton class="field__button"
type="primary"
:id="id"
:aria-label="t('theming', 'Select a custom color')"
data-admin-theming-setting-primary-color-picker>
{{ value }}
<NcButton type="secondary"
:id="id">
<template #icon>
<Palette :size="20" />
</template>
{{ t('theming', 'Change color') }}
</NcButton>
</NcColorPicker>
<div class="field__color-preview" data-admin-theming-setting-primary-color />
<NcButton v-if="value !== defaultValue"
type="tertiary"
:aria-label="t('theming', 'Reset to default')"
Expand All @@ -60,6 +62,7 @@ import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcColorPicker from '@nextcloud/vue/dist/Components/NcColorPicker.js'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'
import Undo from 'vue-material-design-icons/UndoVariant.vue'
import Palette from 'vue-material-design-icons/Palette.vue'
import TextValueMixin from '../../mixins/admin/TextValueMixin.js'
Expand All @@ -71,6 +74,7 @@ export default {
NcColorPicker,
NcNoteCard,
Undo,
Palette,
},
mixins: [
Expand Down Expand Up @@ -108,28 +112,10 @@ export default {
@import './shared/field.scss';
.field {
// Override default NcButton styles
&__button {
width: 230px !important;
border-radius: var(--border-radius-large) !important;
background-color: var(--color-primary-default) !important;
// emulated hover state because it would not make sense
// to create a dedicated global variable for the color-primary-default
&:hover::after {
background-color: white;
content: "";
position: absolute;
width: 100%;
height: 100%;
opacity: .2;
filter: var(--primary-invert-if-bright);
}
// Above the ::after
&::v-deep * {
z-index: 1;
}
&__color-preview {
width: var(--default-clickable-area);
border-radius: var(--border-radius-large);
background-color: var(--color-primary-default);
}
}
</style>

0 comments on commit b025ee0

Please sign in to comment.