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

9353 9354 button styling #9394

Merged
merged 5 commits into from
Jul 13, 2023
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
8 changes: 8 additions & 0 deletions changelog/unreleased/enhancement-button-styling
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Enhancement: Button styling

Button styling (colors and hover colors) has been improved in both light and dark mode to be more consistent among various button styles (colors for filled and outline buttons)

https://github.com/owncloud/web/pull/9394
https://github.com/owncloud/web/issues/9353
https://github.com/owncloud/web/issues/9354

28 changes: 26 additions & 2 deletions packages/design-system/src/components/OcButton/OcButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,17 @@ export default defineComponent({
.oc-icon > svg {
fill: $contrast-color;
}

&:hover:not([disabled]),
&:focus:not([disabled]) {
color: $contrast-color;
background-color: $hover-color;
border-color: $hover-color;

.oc-icon > svg {
fill: $contrast-color;
}
}
}

&-outline {
Expand All @@ -275,8 +286,8 @@ export default defineComponent({
&-outline:hover:not([disabled]),
&-outline:focus:not([disabled]) {
color: $contrast-color;
background-color: $color;
border-color: $color;
background-color: $hover-color;
border-color: $hover-color;

.oc-icon > svg {
fill: $contrast-color;
Expand Down Expand Up @@ -376,6 +387,19 @@ export default defineComponent({
var(--oc-color-swatch-passive-muted),
var(--oc-color-swatch-passive-contrast)
);

&-outline {
&:focus:not([disabled]),
&:hover:not([disabled]) {
color: var(--oc-color-swatch-passive-default);
background-color: var(--oc-color-swatch-passive-hover-outline);
border-color: var(--oc-color-swatch-passive-hover-outline);

.oc-icon > svg {
fill: var(--oc-color-swatch-passive-default);
}
}
}
}

&-brand {
Expand Down
16 changes: 14 additions & 2 deletions packages/design-system/src/styles/theme/background.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
@mixin oc-background-primary-gradient {
background:
linear-gradient(90deg,
linear-gradient(
90deg,
var(--oc-color-swatch-primary-muted) 0%,
var(--oc-color-swatch-primary-gradient) 100%);
var(--oc-color-swatch-primary-gradient) 100%
);

&:focus:not([disabled]),
&:hover:not([disabled])
{
background: linear-gradient(
90deg,
var(--oc-color-swatch-primary-muted-hover) 0%,
var(--oc-color-swatch-primary-gradient-hover) 100%
);
}
}

.oc-background-selected {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
v-oc-tooltip="hideButtonLabels ? $gettext('Upload') : ''"
:aria-label="uploadButtonAriaLabel"
:disabled="uploadOrFileCreationBlocked"
appearance="outline"
variation="passive"
>
<oc-icon name="upload" fill-type="line" />
<span v-if="!hideButtonLabels" v-text="$gettext('Upload')" />
Expand Down
21 changes: 13 additions & 8 deletions packages/web-runtime/themes/owncloud/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,29 @@
"swatch-brand-contrast": "#ffffff",
"swatch-danger-contrast": "#ffffff",
"swatch-danger-default": "rgb(197, 48, 48)",
"swatch-danger-hover": "rgb(168, 40, 40)",
"swatch-danger-hover": "#b12b2b",
"swatch-danger-muted": "rgb(204, 117, 117)",
"swatch-inverse-default": "#ffffff",
"swatch-inverse-hover": "#ffffff",
"swatch-inverse-muted": "#bfbfbf",
"swatch-passive-default": "#4c5f79",
"swatch-passive-hover": "#97a2b1",
"swatch-passive-hover": "#43536b",
"swatch-passive-hover-outline": "#f7fafd",
"swatch-passive-muted": "#283e5d",
"swatch-passive-contrast": "#ffffff",
"swatch-primary-default": "#4a76ac",
"swatch-primary-hover": "#80a7d7",
"swatch-primary-muted": "#2c588e",
"swatch-primary-muted-hover": "rgb(36, 75, 119)",
"swatch-primary-gradient": "#4e85c8",
"swatch-primary-gradient-hover": "rgb(59, 118, 194)",
"swatch-primary-contrast": "#ffffff",
"swatch-success-default": "rgb(3, 84, 63)",
"swatch-success-hover": "rgb(147, 224, 84)",
"swatch-success-hover": "#023b2c",
"swatch-success-muted": "rgb(83, 150, 10)",
"swatch-success-contrast": "#ffffff",
"swatch-warning-default": "rgb(183, 76, 27)",
"swatch-warning-hover": "rgb(183, 76, 27)",
"swatch-warning-hover": "#a04318",
"swatch-warning-muted": "rgba(183, 76, 27, .5)",
"swatch-warning-contrast": "#ffffff",
"text-default": "#041e42",
Expand Down Expand Up @@ -129,24 +132,26 @@
"swatch-inverse-muted": "#696969",
"swatch-passive-default": "#c2c2c2",
"swatch-passive-hover": "",
"swatch-passive-hover-outline": "#3B3B3B",
"swatch-passive-muted": "#bdbfc3",
"swatch-passive-contrast": "#000000",
"swatch-primary-default": "#73b0f2",
"swatch-primary-hover": "#7bafef",
"swatch-primary-muted": "",
"swatch-primary-muted-hover": "#2282f7",
"swatch-primary-gradient": "#4e85c8",
"swatch-primary-gradient-hover": "#76a1d5",
"swatch-primary-contrast": "#dadcdf",
"swatch-success-background": "rgba(0, 188, 140, 0)",
"swatch-success-default": "rgb(0, 188, 140)",
"swatch-success-hover": "rgb(0, 188, 140)",
"swatch-success-hover": "#00f0b4",
"swatch-success-muted": "rgba(0, 188, 140, .5)",
"swatch-success-contrast": "#000000",
"swatch-warning-background": "rgba(0,0,0,0)",
"swatch-warning-default": "rgb(232, 191, 73)",
"swatch-warning-hover": "rgb(232, 178, 19)",
"swatch-warning-hover": "#eed077",
"swatch-warning-muted": "rgba(232, 178, 19, .5)",
"swatch-danger-default": "rgb(255, 72, 53)",
"swatch-danger-hover": "rgb(255, 72, 53)",
"swatch-danger-hover": "#ff7566",
"swatch-danger-muted": "rgba(255, 72, 53, .5)",
"swatch-danger-contrast": "#dadcdf",
"swatch-warning-contrast": "#000000",
Expand Down