Skip to content

Commit 00f8468

Browse files
committed
[css-color-5] Add hover effect on swatch, move to separate stylesheet
1 parent 25a3464 commit 00f8468

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

css-color-5/Overview.bs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,7 @@ Repository: w3c/csswg-drafts
1919
spec:css-color-4; type:dfn; text:colorspace
2020
spec:css-color-4; type:dfn; text:gamut
2121
</pre>
22-
23-
<style>
24-
.swatch {
25-
display: inline-block;
26-
vertical-align: calc(-.1em - 3px);
27-
padding: .6em;
28-
background-color: var(--color);
29-
border: 3px solid white;
30-
border-radius: 3px;
31-
box-shadow: 1px 1px 1px rgba(0,0,0,.15)
32-
}
33-
</style>
22+
<link rel="stylesheet" href="style.css" />
3423

3524
Introduction {#intro}
3625
=====================

css-color-5/style.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.swatch {
2+
position: relative;
3+
z-index: 1;
4+
display: inline-block;
5+
vertical-align: calc(-.1em - 3px);
6+
padding: .6em;
7+
background-color: var(--color);
8+
border: 3px solid white;
9+
border-radius: 3px;
10+
box-shadow: 1px 1px 1px rgba(0,0,0,.15)
11+
}
12+
13+
.swatch:hover {
14+
transform: scale(3);
15+
border-radius: 2px;
16+
transition: .4s;
17+
}

0 commit comments

Comments
 (0)