Skip to content

Commit

Permalink
feat(message): add dismissible class to manage grid columns
Browse files Browse the repository at this point in the history
Signed-off-by: astagnol <[email protected]>
  • Loading branch information
astagnol authored and dpellier committed Nov 4, 2024
1 parent a5156f3 commit 9a2be2e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

@include message.ods-message();

&__dismissible {
grid-template-columns: max-content 1fr;
}

&__icon {
padding: 0.125rem 0;
font-size: 1.25rem;
Expand All @@ -24,7 +28,6 @@
}

&__close {
grid-column: 3;
height: auto;

&--critical::part(button) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class OdsMessage {
return (
<Host class="ods-message">
<div
class={ `ods-message__message ods-message__message--${this.color} ods-message__message--${this.variant}` }
class={ `ods-message__message ods-message__message--${this.color} ods-message__message--${this.variant} ${this.isDismissible ? '' : 'ods-message__message__dismissible'}` }
part="message">
<ods-icon
class="ods-message__message__icon"
Expand Down
2 changes: 1 addition & 1 deletion packages/ods/src/style/_message.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@mixin ods-message() {
display: grid;
grid-template-rows: min-content;
grid-template-columns: max-content 1fr;
grid-template-columns: max-content 1fr max-content;
column-gap: 0.5rem;
padding: 0.5rem;
}
Expand Down

0 comments on commit 9a2be2e

Please sign in to comment.