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

fix(NcModal): Adjust modal header name and actions #5656

Merged
merged 2 commits into from
Jun 14, 2024
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
30 changes: 15 additions & 15 deletions src/components/NcModal/NcModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ depending on whether you require the Modal to stay within the DOM or not. Do not
:outTransition="true"
:hasNext="true"
:hasPrevious="true">
<template #actions>
<NcActionCaption name="Some action" />
</template>
<div class="modal__content">Hello world</div>
</NcModal>
</div>
Expand Down Expand Up @@ -214,10 +217,10 @@ export default {
tabindex="-1">
<!-- Header -->
<transition name="fade-visibility" appear>
<div class="modal-header">
<div class="modal-header" data-theme-dark>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to work if a theme is enforced ⚠️

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That requires a fix on server I think, to ensure we at least load the dark theme with data attribute if another one is enforced 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then talk has a problem as they are using this to have the dark "chat view" on every theme

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's k, this is an edge case :)
Hope the server fix suits you! 👍

<h2 v-if="name.trim() !== ''"
:id="'modal-name-' + randId"
class="modal-name">
class="modal-header__name">
{{ name }}
</h2>
<div class="icons-menu">
Expand Down Expand Up @@ -256,7 +259,7 @@ export default {

<!-- Actions menu -->
<NcActions class="header-actions" :inline="inlineActions">
<!-- @slot List of actions to show -->
<!-- @slot Actions to show (one or more NcAction* components) -->
<slot name="actions" />
</NcActions>

Expand Down Expand Up @@ -840,22 +843,21 @@ export default {
overflow: hidden;
transition: opacity 250ms, visibility 250ms;

.modal-name {
&__name {
overflow-x: hidden;
box-sizing: border-box;
width: 100%;
padding: 0 #{$clickable-area * 3} 0 12px; // maximum actions is 3
transition: padding ease 100ms;
white-space: nowrap;
text-overflow: ellipsis;
color: #fff;
font-size: $icon-margin;
margin-bottom: 0;
font-size: $icon-size;
margin-block: 0;
}

// On wider screens the name can be centered
@media only screen and (min-width: $breakpoint-mobile) {
.modal-name {
&__name {
padding-left: #{$clickable-area * 3}; // maximum actions is 3
text-align: center;
}
Expand Down Expand Up @@ -906,10 +908,6 @@ export default {
}
}

.header-actions {
color: white;
}

&:deep() .action-item {
margin: math.div($header-height - $clickable-area, 2);

Expand All @@ -923,9 +921,11 @@ export default {
}
}

:deep(button) {
// force white instead of default main text
color: #fff;
// The modal ignores the color theme and adds a black backdrop
// so we need to add custom color of the actions toggle
.header-actions :deep(button:focus-visible) {
box-shadow: none !important;
outline: 2px solid #fff !important;
}

// Force the Actions menu icon to be the same size as other icons
Expand Down
1 change: 1 addition & 0 deletions styleguide/assets/additional.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import 'default.css';
@import 'server.css';
@import 'dark.css';

div[data-preview] * {
box-sizing: border-box;
Expand Down
89 changes: 89 additions & 0 deletions styleguide/assets/dark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
[data-theme-dark] {
--color-main-background:#171717;
--color-main-background-rgb:23,23,23;
--color-main-background-translucent:rgba(var(--color-main-background-rgb), .97);
--color-main-background-blur:rgba(var(--color-main-background-rgb), .85);
--filter-background-blur:blur(25px);
--gradient-main-background:var(--color-main-background) 0%, var(--color-main-background-translucent) 85%, transparent 100%;
--color-background-hover:#212121;
--color-background-dark:#292929;
--color-background-darker:#3b3b3b;
--color-placeholder-light:#313131;
--color-placeholder-dark:#4a4a4a;
--color-main-text:#EBEBEB;
--color-text-maxcontrast:#999999;
--color-text-maxcontrast-default:#999999;
--color-text-maxcontrast-background-blur:#a8a8a8;
--color-text-light:var(--color-main-text);
--color-text-lighter:var(--color-text-maxcontrast);
--color-scrollbar:#3d3d3d;
--color-error:#FF3333;
--color-error-rgb:255,51,51;
--color-error-hover:#ff6666;
--color-error-text:#ff8080;
--color-warning:#FFCC00;
--color-warning-rgb:255,204,0;
--color-warning-hover:#ffd633;
--color-warning-text:#FFCC00;
--color-success:#3B973B;
--color-success-rgb:59,151,59;
--color-success-hover:#4cb94c;
--color-success-text:#5ec05e;
--color-info:#00AEFF;
--color-info-rgb:0,174,255;
--color-info-hover:#33beff;
--color-info-text:#00AEFF;
--color-favorite:#ffde00;
--color-loading-light:#777;
--color-loading-dark:#CCC;
--color-box-shadow-rgb:0,0,0;
--color-box-shadow:#000000;
--color-border:#292929;
--color-border-dark:#3b3b3b;
--color-border-maxcontrast:#7d7d7d;
--font-face:system-ui, -apple-system, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Ubuntu, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--default-font-size:15px;
--animation-quick:100ms;
--animation-slow:300ms;
--border-width-input:1px;
--border-width-input-focused:2px;
--border-radius:3px;
--border-radius-large:10px;
--border-radius-rounded:28px;
--border-radius-element:10px;
--border-radius-pill:100px;
--default-clickable-area:44px;
--default-line-height:24px;
--default-grid-baseline:4px;
--header-height:50px;
--navigation-width:300px;
--sidebar-min-width:300px;
--sidebar-max-width:500px;
--list-min-width:200px;
--list-max-width:300px;
--header-menu-item-height:44px;
--header-menu-profile-item-height:66px;
--breakpoint-mobile:1024px;
--background-invert-if-dark:invert(100%);
--background-invert-if-bright:no;
--background-image-invert-if-bright:no;
--primary-invert-if-bright:invert(100%);
--primary-invert-if-dark:no;
--color-primary:#00679e;
--color-primary-text:#ffffff;
--color-primary-hover:#045783;
--color-primary-light:#14232c;
--color-primary-light-text:#99c2d8;
--color-primary-light-hover:#1e2d35;
--color-primary-element:#0091f2;
--color-primary-element-hover:#079cff;
--color-primary-element-text:#000000;
--color-primary-element-text-dark:#0a0a0a;
--color-primary-element-light:#14232c;
--color-primary-element-light-hover:#1e2d35;
--color-primary-element-light-text:#99d3f9;
--gradient-primary-background:linear-gradient(40deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
--color-background-plain:#00679e;
--color-background-plain-text:#ffffff;
--image-background: url('./img/background/kamil-porembinski-clouds.jpg');
}
Loading