Skip to content

Commit eadd738

Browse files
committed
wip: aura button styles
1 parent 5cca707 commit eadd738

File tree

3 files changed

+45
-10
lines changed

3 files changed

+45
-10
lines changed

s/components/button/style.css.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ button {
4141
color: inherit;
4242
cursor: inherit;
4343
outline: inherit;
44+
text-shadow: inherit;
4445
4546
display: inline-flex;
4647
justify-content: center;

s/demo/demo.bundle.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,23 @@ dom.register({ShinyDemo: view.component(use => {
132132
}
133133
`],
134134
],
135-
content: (
135+
content: [
136136
views.ShinyButton
137137
.props()
138138
.children("hello")
139-
.render()
140-
),
139+
.render(),
140+
views.ShinyButton
141+
.props()
142+
.attr("border-gradient", true)
143+
.children("hello")
144+
.render(),
145+
views.ShinyButton
146+
.props()
147+
.attr("angry", true)
148+
.attr("border-gradient", true)
149+
.children("hello")
150+
.render(),
151+
],
141152
style: css`
142153
.content sly-view {
143154
font-size: 2em;

s/themes/aura.css.ts

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,49 @@ export const aura = css`@layer overlay {
99
})}
1010
}
1111
12-
xxx:host([view="shiny-button"]) {
12+
:host([view="shiny-button"]) {
1313
position: relative;
1414
15+
--b-bg: var(--calm);
1516
--padding: 0.3em 0.7em;
17+
18+
color: white;
1619
border-radius: 2em;
20+
background: var(--b-bg);
21+
border: none;
22+
23+
font-weight: medium;
24+
text-shadow: 0.1em 0.1em 0.1em #0004;
25+
box-shadow: 0.1em 0.2em 0.3em #0002;
26+
}
27+
28+
:host([view="shiny-button"][angry]) {
29+
--b-bg: var(--angry);
30+
}
31+
32+
:host([view="shiny-button"][border-gradient]) {
33+
border: none;
1734
background: linear-gradient(
1835
to bottom right,
19-
cyan,
20-
blue
36+
color-mix(in oklab, var(--b-bg), white 80%),
37+
color-mix(in oklab, var(--b-bg), black 40%)
2138
);
22-
border: none;
23-
box-shadow: 0.1em 0.2em 0.3em #0004;
2439
2540
&::before {
2641
content: "";
2742
display: block;
2843
position: absolute;
29-
inset: 0;
30-
background: red;
44+
z-index: 0;
45+
inset: 0.15em;
46+
border-radius: inherit;
47+
background: color-mix(in oklab, var(--b-bg), #0004 50%);
3148
}
49+
50+
> * {
51+
position: relative;
52+
z-index: 1;
53+
}
54+
3255
}
3356
3457
:host([view="shiny-drawer"]) {

0 commit comments

Comments
 (0)