Skip to content

Commit ba3e5ad

Browse files
authored
Merge pull request #54178 from nextcloud/feat/app-icon-opacity
feat(AppMenu): add slight opactiy gradient to app icons
2 parents 47fd370 + 4e4c4d1 commit ba3e5ad

File tree

10 files changed

+27
-9
lines changed

10 files changed

+27
-9
lines changed

apps/theming/css/default.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,15 @@
7474
--clickable-area-large: 48px;
7575
--clickable-area-small: 24px;
7676
--default-grid-baseline: 4px;
77+
7778
--header-height: 50px;
7879
--header-menu-item-height: 44px;
80+
/* An alpha mask to be applied to all icons on the navigation bar (header menu).
81+
* Icons are have a size of 20px but usually we use MDI which have a content of 16px so 2px padding top bottom,
82+
* for better gradient we set those 2px (10% of height) as start and stop positions, this is also somewhat size agnostic as we only depend on the percentage.
83+
*/
84+
--header-menu-icon-mask: linear-gradient(var(--color-background-plain-text) 10%, color-mix(in srgb, var(--color-background-plain-text), 25% transparent) 90%) alpha;
85+
7986
--navigation-width: 300px;
8087
--sidebar-min-width: 300px;
8188
--sidebar-max-width: 500px;

apps/theming/lib/Themes/DefaultTheme.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,16 @@ public function getCSSVariables(): array {
191191

192192
'--default-grid-baseline' => '4px',
193193

194-
// various structure data
194+
// header / navigation bar
195195
'--header-height' => '50px',
196196
'--header-menu-item-height' => '44px',
197+
/* An alpha mask to be applied to all icons on the navigation bar (header menu).
198+
* Icons are have a size of 20px but usually we use MDI which have a content of 16px so 2px padding top bottom,
199+
* for better gradient we set those 2px (10% of height) as start and stop positions, this is also somewhat size agnostic as we only depend on the percentage.
200+
*/
201+
'--header-menu-icon-mask' => 'linear-gradient(var(--color-background-plain-text) 10%, color-mix(in srgb, var(--color-background-plain-text), 25% transparent) 90%) alpha',
202+
203+
// various structure data
197204
'--navigation-width' => '300px',
198205
'--sidebar-min-width' => '300px',
199206
'--sidebar-max-width' => '500px',

apps/theming/lib/Themes/HighContrastTheme.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ public function getCSSVariables(): array {
106106
'--color-border' => $this->util->darken($colorMainBackground, 50),
107107
'--color-border-dark' => $this->util->darken($colorMainBackground, 50),
108108
'--color-border-maxcontrast' => $this->util->darken($colorMainBackground, 56),
109+
110+
// remove the gradient from the app icons
111+
'--header-menu-icon-mask' => 'none',
109112
]
110113
);
111114
}

core/css/header.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/css/header.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,8 @@
8585
max-height: calc(100vh - #{variables.$header-height} - 8px);
8686
}
8787

88+
/* Header menu */
8889
#header {
89-
/* Header menu */
90-
$header-menu-entry-height: 44px;
91-
9290
.header-end > div > .menu {
9391
background-color: var(--color-main-background);
9492
filter: drop-shadow(0 1px 5px var(--color-box-shadow));

core/css/server.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/src/components/AppMenuIcon.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ $unread-indicator-size: 10px;
5151
height: $icon-size;
5252
width: $icon-size;
5353
filter: var(--background-image-invert-if-bright);
54+
mask: var(--header-menu-icon-mask);
5455
}
5556
5657
&__unread {

core/src/views/AccountMenu.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ export default defineComponent({
201201
--account-menu-outline: var(--border-width-input) solid color-mix(in srgb, var(--color-background-plain-text), transparent 75%);
202202
outline: var(--account-menu-outline);
203203
position: fixed;
204+
// do not apply the alpha mask on the avatar div
205+
mask: none !important;
204206
205207
&:hover {
206208
--account-menu-outline: none;

dist/core-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)