Skip to content

Commit

Permalink
fix(core/modal): update styling
Browse files Browse the repository at this point in the history
  • Loading branch information
nuke-ellington committed Sep 22, 2022
1 parent cc4a5ae commit 922fc01
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 35 deletions.
1 change: 1 addition & 0 deletions packages/angular-test-app/src/preview-examples/modal.ts
Expand Up @@ -27,6 +27,7 @@ import { ModalService } from '@siemens/ix-angular';
<div class="modal-header">
Message headline
<ix-icon-button
data-button-close
ghost
icon="close"
class="dismiss-modal"
Expand Down
21 changes: 3 additions & 18 deletions packages/core/component-doc.json
Expand Up @@ -4095,9 +4095,7 @@
"docs": "<!--\nSPDX-FileCopyrightText: 2022 Siemens AG\n\nSPDX-License-Identifier: MIT\n-->",
"docsTags": [],
"encapsulation": "none",
"dependents": [
"my-component"
],
"dependents": [],
"dependencies": [
"ix-menu-item",
"ix-dropdown"
Expand All @@ -4106,9 +4104,6 @@
"ix-menu": [
"ix-menu-item",
"ix-dropdown"
],
"my-component": [
"ix-menu"
]
},
"props": [
Expand Down Expand Up @@ -8548,18 +8543,8 @@
"docsTags": [],
"encapsulation": "scoped",
"dependents": [],
"dependencies": [
"ix-menu"
],
"dependencyGraph": {
"my-component": [
"ix-menu"
],
"ix-menu": [
"ix-menu-item",
"ix-dropdown"
]
},
"dependencies": [],
"dependencyGraph": {},
"props": [],
"methods": [],
"events": [],
Expand Down
16 changes: 15 additions & 1 deletion packages/core/scss/components/_modal.scss
Expand Up @@ -9,11 +9,21 @@

@import './mixins/fonts';

.modal {
--bs-modal-footer-gap: 1rem;
--bs-modal-box-shadow: var(--theme-modal--box-shadow);
}

.modal-header {
@include text-default-title;
padding: 0;
padding-bottom: $tiny-space;
border: none;
align-items: flex-start;

[data-close-button] {
margin-left: 1rem;
}
}

.modal-body {
Expand All @@ -23,5 +33,9 @@
.modal-footer {
border-top: none;
padding: 0;
padding-block-start: $large-space;
padding-block-start: 2rem;

> * {
margin: 0 0 0 calc(var(--bs-modal-footer-gap) * 0.5);
}
}
5 changes: 5 additions & 0 deletions packages/core/scss/theme/classic-dark/_sizes.scss
Expand Up @@ -41,6 +41,11 @@ $classic-dark-sizes: (
0.5rem 0 1rem #000,
),
modal--border-thickness: 1px,
modal--box-shadow: (
0 12px 16px rgba(0, 0, 0, 0.1),
0 4px 8px rgba(0, 0, 0, 0.1),
0 0 2px rgba(0, 0, 0, 0.1),
),
switch-thumb--box-shadow: none,
tile--border-radius: 0.25rem,
tile--box-shadow: (
Expand Down
5 changes: 5 additions & 0 deletions packages/core/scss/theme/classic-light/_sizes.scss
Expand Up @@ -41,6 +41,11 @@ $classic-light-sizes: (
0.5rem 0 1rem rgba(0, 0, 0, 0.2),
),
modal--border-thickness: 1px,
modal--box-shadow: (
0 12px 16px rgba(0, 0, 0, 0.1),
0 4px 8px rgba(0, 0, 0, 0.1),
0 0 2px rgba(0, 0, 0, 0.1),
),
switch-thumb--box-shadow: none,
tile--border-radius: 0.25rem,
tile--box-shadow: (
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/components/modal/modal.scss
Expand Up @@ -26,6 +26,7 @@
}

&.backdrop {
background-color: var(--theme-color-lightbox);
backdrop-filter: blur(4px);
transition: none;

Expand All @@ -48,7 +49,7 @@
}

.modal-content {
//@include box-shadow(4);
box-shadow: var(--theme-modal--box-shadow);
flex-direction: row;
background-color: var(--theme-modal--background);
border: var(--modal--border-thickness) solid
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -31,6 +31,7 @@ export class ModalExample {
<div class="modal-header">
Message headline
<ix-icon-button
data-close-button
ghost
icon="close"
onClick={() => this.dismiss()}
Expand Down
6 changes: 1 addition & 5 deletions packages/core/src/components/my-component/my-component.tsx
Expand Up @@ -16,10 +16,6 @@ import { Component, h, Host } from '@stencil/core';
})
export class MyComponent {
render() {
return (
<Host>
<ix-menu enableToggleTheme={true}></ix-menu>
</Host>
);
return <Host></Host>;
}
}
Expand Up @@ -35,6 +35,7 @@ import { ModalService } from '@siemens/ix-angular';
<div class="modal-header">
Message headline
<ix-icon-button
data-button-close
ghost
icon="close"
class="dismiss-modal"
Expand Down
Expand Up @@ -16,11 +16,11 @@ SPDX-License-Identifier: MIT
*/

import {
IxButton,
IxIconButton,
Modal,
ModalRef,
showModal
IxButton,
IxIconButton,
Modal,
ModalRef,
showModal,
} from '@siemens/ix-react';
import { useRef } from 'react';

Expand All @@ -39,6 +39,7 @@ function CustomModal() {
<div className="modal-header">
Message headline
<IxIconButton
data-button-close
ghost
icon="close"
onClick={() => dismiss()}
Expand Down
Expand Up @@ -20,6 +20,7 @@ SPDX-License-Identifier: MIT
<div class="modal-header">
Message headline
<ix-icon-button
data-button-close
ghost
icon="close"
class="dismiss-modal"
Expand Down
Expand Up @@ -35,6 +35,7 @@
<div class="modal-header">
Message headline
<ix-icon-button
data-button-close
ghost
icon="close"
class="dismiss-modal"
Expand Down
11 changes: 6 additions & 5 deletions packages/react-test-app/src/preview-examples/modal.tsx
Expand Up @@ -8,11 +8,11 @@
*/

import {
IxButton,
IxIconButton,
Modal,
ModalRef,
showModal
IxButton,
IxIconButton,
Modal,
ModalRef,
showModal,
} from '@siemens/ix-react';
import { useRef } from 'react';

Expand All @@ -31,6 +31,7 @@ function CustomModal() {
<div className="modal-header">
Message headline
<IxIconButton
data-button-close
ghost
icon="close"
onClick={() => dismiss()}
Expand Down

0 comments on commit 922fc01

Please sign in to comment.