aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorAndy Scherzinger <info@andy-scherzinger.de>2024-02-06 10:19:56 +0100
committerGitHub <noreply@github.com>2024-02-06 10:19:56 +0100
commitde19878cdf8976e783cdb8d0cb593c437ac4b404 (patch)
tree9097fa1c19bbb3c395fd4a4ea1e78777b695c9e1 /apps
parent341375b75009abf4b95a59365e7e9b3f0ea9ae90 (diff)
parentbccad8350c8e92b021e87dcb69b87880ad09ce5f (diff)
downloadnextcloud-server-de19878cdf8976e783cdb8d0cb593c437ac4b404.tar.gz
nextcloud-server-de19878cdf8976e783cdb8d0cb593c437ac4b404.zip
Merge pull request #43347 from nextcloud/backport/42552/stable28
[stable28] fix(theming): change color button contrast
Diffstat (limited to 'apps')
-rw-r--r--apps/theming/src/AdminTheming.vue1
-rw-r--r--apps/theming/src/components/BackgroundSettings.vue37
-rw-r--r--apps/theming/src/components/admin/ColorPickerField.vue42
3 files changed, 36 insertions, 44 deletions
diff --git a/apps/theming/src/AdminTheming.vue b/apps/theming/src/AdminTheming.vue
index daef18ebdce..2face1629ef 100644
--- a/apps/theming/src/AdminTheming.vue
+++ b/apps/theming/src/AdminTheming.vue
@@ -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 -->
diff --git a/apps/theming/src/components/BackgroundSettings.vue b/apps/theming/src/components/BackgroundSettings.vue
index 0a8c49be45e..deb0a93a51a 100644
--- a/apps/theming/src/components/BackgroundSettings.vue
+++ b/apps/theming/src/components/BackgroundSettings.vue
@@ -58,16 +58,15 @@
</button>
<!-- Custom color picker -->
- <NcColorPicker v-model="Theming.color" @input="debouncePickColor">
- <button class="background background__color"
- :data-color="Theming.color"
- :data-color-bright="invertTextColor(Theming.color)"
- :style="{ backgroundColor: Theming.color, '--border-color': Theming.color}"
- data-user-theming-background-color
- tabindex="0">
- {{ t('theming', 'Change color') }}
- </button>
- </NcColorPicker>
+ <div class="background-color"
+ data-user-theming-background-color>
+ <NcColorPicker v-model="Theming.color"
+ @input="debouncePickColor">
+ <NcButton type="ternary">
+ {{ t('theming', 'Change color') }}
+ </NcButton>
+ </NcColorPicker>
+ </div>
<!-- Remove background -->
<button :aria-pressed="isBackgroundDisabled"
@@ -113,6 +112,7 @@ import { Palette } from 'node-vibrant/lib/color.js'
import axios from '@nextcloud/axios'
import debounce from 'debounce'
import NcColorPicker from '@nextcloud/vue/dist/Components/NcColorPicker.js'
+import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import Vibrant from 'node-vibrant'
import Check from 'vue-material-design-icons/Check.vue'
@@ -133,6 +133,7 @@ export default {
Check,
Close,
ImageEdit,
+ NcButton,
NcColorPicker,
},
@@ -341,6 +342,17 @@ export default {
flex-wrap: wrap;
justify-content: center;
+ .background-color {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 176px;
+ height: 96px;
+ margin: 8px;
+ border-radius: var(--border-radius-large);
+ background-color: var(--color-primary);
+ }
+
.background {
overflow: hidden;
width: 176px;
@@ -368,11 +380,6 @@ export default {
border-color: var(--color-border);
}
- &__color {
- color: var(--color-primary-text);
- background-color: var(--color-primary-default);
- }
-
// Over a background image
&__default,
&__shipped {
diff --git a/apps/theming/src/components/admin/ColorPickerField.vue b/apps/theming/src/components/admin/ColorPickerField.vue
index 7885bfeb233..fad40408b37 100644
--- a/apps/theming/src/components/admin/ColorPickerField.vue
+++ b/apps/theming/src/components/admin/ColorPickerField.vue
@@ -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')"
@@ -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'
@@ -71,6 +74,7 @@ export default {
NcColorPicker,
NcNoteCard,
Undo,
+ Palette,
},
mixins: [
@@ -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>