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

feat: enable link for notification variant=overlay #2662

Merged
merged 8 commits into from
Jul 8, 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -62,58 +62,5 @@
}
}
}

&[data-link-variant="inline"] {
// 1. only content (min. requirement)
grid-template-areas: "content link";
grid-template-columns: 1fr min-content;

&:has(.db-button) {
grid-template-columns: 1fr min-content min-content;
grid-template-areas: "content link close";
}

// 2. headline
&:has(header) {
grid-template-columns: 1fr min-content;
grid-template-areas:
"head link"
"content content";

&:has(.db-button) {
grid-template-columns: 1fr min-content min-content;
grid-template-areas:
"head link close"
"content content content";
}
}

// 3. icon or img
&[data-icon],
&[data-semantic]:not([data-semantic="adaptive"]),
&:has(img) {
grid-template-areas: "icon content link";
grid-template-columns: min-content 1fr min-content;

&:has(.db-button) {
grid-template-columns: min-content 1fr min-content min-content;
grid-template-areas: "icon content link close";
}

&:has(header) {
grid-template-columns: min-content 1fr min-content;
grid-template-areas:
"icon head link"
"icon content content";

&:has(.db-button) {
grid-template-columns: min-content 1fr min-content min-content;
grid-template-areas:
"icon head link close"
"icon content content content";
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
%grid-layout-variant-overlay {
a {
display: none;
}

// has timestamp
&:has(span) {
// 1. only content (min. requirement)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,63 @@
grid-area: icon;
}

// has link inline or overlay
&:has(a) {
&[data-link-variant="inline"],
&[data-variant="overlay"] {
// 1. only content (min. requirement)
grid-template-areas: "content link";
grid-template-columns: 1fr min-content;

&:has(.db-button) {
grid-template-columns: 1fr min-content min-content;
grid-template-areas: "content link close";
}

// 2. headline
&:has(header) {
grid-template-columns: 1fr min-content;
grid-template-areas:
"head link"
"content content";

&:has(.db-button) {
grid-template-columns: 1fr min-content min-content;
grid-template-areas:
"head link close"
"content content content";
}
}

// 3. icon or img
&[data-icon],
&[data-semantic]:not([data-semantic="adaptive"]),
&:has(img) {
grid-template-areas: "icon content link";
grid-template-columns: min-content 1fr min-content;

&:has(.db-button) {
grid-template-columns: min-content 1fr min-content min-content;
grid-template-areas: "icon content link close";
}

&:has(header) {
grid-template-columns: min-content 1fr min-content;
grid-template-areas:
"icon head link"
"icon content content";

&:has(.db-button) {
grid-template-columns: min-content 1fr min-content min-content;
grid-template-areas:
"icon head link close"
"icon content content content";
}
}
}
}
}

&[data-variant="overlay"] {
@extend %grid-layout-variant-overlay;
box-shadow: variables.$db-elevation-md;
Expand Down
28 changes: 28 additions & 0 deletions showcases/shared/notification.json
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,34 @@
"behaviour": "permanent"
}
},
{
"name": "Text & Textlink Inline",
"style": { "width": "300px" },
"props": {
"link": true,
"variant": "overlay",
"behaviour": "permanent"
}
},
{
"name": "Text & Headline & Textlink Inline & Cloaseable",
"style": { "width": "300px" },
"props": {
"headline": "Headline",
"link": true,
"variant": "overlay"
}
},
{
"name": "Text & Icon & Headline & Textlink Inline & Cloaseable",
"style": { "width": "300px" },
"props": {
"icon": "information_circle",
"headline": "Headline",
"link": true,
"variant": "overlay"
}
},
{
"name": "Text & Timed",
"style": { "width": "300px" },
Expand Down
Loading