Skip to content

Commit b03a13b

Browse files
committed
live-web-view.content: Added Alert.
1 parent 828d5a7 commit b03a13b

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import live-web.dom
2+
import live-web
3+
import live-elements-web-server.view
4+
import live-elements-web-server.style
5+
6+
component Alert < Div{
7+
8+
string type: null
9+
10+
static any[] use = [
11+
AlertContent,
12+
ScopedStyle{ src: './style/alert.css' process: '../style/CSSProcessor.lv' },
13+
ScopedStyle{ src: '../style/global.css' process: '../style/CSSProcessor.lv' }
14+
]
15+
16+
string[] extraClasses: []
17+
classes: this.extraClasses.concat([
18+
ScopedStyle.className(Alert),
19+
this.type ? `type-${this.type}` : '',
20+
])
21+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import live-web.dom
2+
import live-web
3+
import live-elements-web-server.view
4+
import live-elements-web-server.style
5+
6+
component AlertContent < Div{
7+
string[] extraClasses: []
8+
classes: this.extraClasses.concat(ScopedStyle.className(AlertContent))
9+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
&Alert{
2+
@apply flex flex-row items-start bg-white dark:bg-[#111] text-black dark:text-[#e1e1e1] rounded shadow-md max-w-sm overflow-hidden;
3+
@apply border border-[#313131] p-4 px-4;
4+
}
5+
&AlertContent{
6+
@apply text-left;
7+
flex-grow: 1;
8+
}
9+
&Alert&.type-error{
10+
@apply border-[rgb(162,32,40,0.80)];
11+
}
12+
&Alert&.type-error heading{
13+
@apply text-[rgb(162,32,40)];
14+
}
15+
figure{
16+
@apply p-1 pr-4;
17+
flex-shrink: 0;
18+
}
19+
&Alert&.type-error figure svg{
20+
@apply text-[rgb(162,32,40)];
21+
}
22+
section{
23+
@apply text-base text-left leading-snug;
24+
}
25+
section header{
26+
@apply mb-1;
27+
}

0 commit comments

Comments
 (0)