fix: pill style; global style
Fixes an issue with <img> inside <figure> not being centered
This commit is contained in:
parent
9a4afabbd7
commit
1d172811ef
3 changed files with 60 additions and 17 deletions
|
@ -1,13 +1,32 @@
|
||||||
.pill {
|
.pill {
|
||||||
background-color: var(--color-surface);
|
display: inline-flex;
|
||||||
border-radius: var(--spacing-1);
|
align-items: center;
|
||||||
display: flex;
|
|
||||||
padding-inline: var(--spacing-1);
|
padding-inline: var(--spacing-1);
|
||||||
padding-block: var(--spacing-0\.5);
|
padding-block: var(--spacing-0\.5);
|
||||||
gap: var(--spacing-0\.5);
|
gap: var(--spacing-0\.5);
|
||||||
transition:
|
position: relative;
|
||||||
transform var(--transition-duration),
|
|
||||||
background-color 75ms;
|
transition: transform 0.1s ease;
|
||||||
|
|
||||||
|
&::before,
|
||||||
|
&::after {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
content: "";
|
||||||
|
z-index: -1;
|
||||||
|
border-radius: var(--spacing-1);
|
||||||
|
|
||||||
|
transition: opacity 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
background-color: var(--color-surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
background-color: var(--color-text);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pill[data-state="small"] {
|
.pill[data-state="small"] {
|
||||||
|
@ -28,13 +47,22 @@
|
||||||
border-radius: var(--spacing-0\.5);
|
border-radius: var(--spacing-0\.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.pill:not([data-state]):hover {
|
button.pill:hover,
|
||||||
background-color: var(--color-text);
|
a[href].pill:hover {
|
||||||
color: var(--color-primary);
|
color: var(--color-primary);
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pill:not([data-state]):active {
|
button.pill:active,
|
||||||
|
a[href].pill:active {
|
||||||
transform: translateY(2px);
|
transform: translateY(2px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,6 +74,9 @@ a.pill {
|
||||||
color: var(--color-fadeText);
|
color: var(--color-fadeText);
|
||||||
}
|
}
|
||||||
|
|
||||||
.pill:not([data-state]):hover .pill-count {
|
button.pill:hover,
|
||||||
color: var(--color-border);
|
a[href].pill:hover {
|
||||||
|
.pill-count {
|
||||||
|
color: var(--color-border);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,6 +140,9 @@ pre {
|
||||||
}
|
}
|
||||||
|
|
||||||
figure {
|
figure {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
margin-inline: 0;
|
margin-inline: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,12 +154,6 @@ figure figcaption {
|
||||||
margin-block-start: var(--flow-space, 1em);
|
margin-block-start: var(--flow-space, 1em);
|
||||||
}
|
}
|
||||||
|
|
||||||
picture {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
picture source,
|
picture source,
|
||||||
picture img {
|
picture img {
|
||||||
border-radius: var(--spacing-0\.5);
|
border-radius: var(--spacing-0\.5);
|
||||||
|
|
|
@ -34,6 +34,21 @@ description: A demo of the site's theme.
|
||||||
<div class="[ size-2 ]" style="background-color: var(--color-shadow)"></div>
|
<div class="[ size-2 ]" style="background-color: var(--color-shadow)"></div>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
|
<div class="[ flex ]">
|
||||||
|
<a href="#" class="[ button ]">A button</a>
|
||||||
|
</div>
|
||||||
|
<div class="[ flex flex-wrap gap-1 ]">
|
||||||
|
<a href="#" class="[ pill ]">A pill</a>
|
||||||
|
<a href="#" class="[ pill ]">
|
||||||
|
A pill link with a count <span class="[ pill-count ]">3</span>
|
||||||
|
</a>
|
||||||
|
<p class="[ pill ]">
|
||||||
|
A pill with a count <span class="[ pill-count ]">3</span>
|
||||||
|
</p>
|
||||||
|
<p class="[ pill ]" data-state="small">A small pill</p>
|
||||||
|
<p class="[ pill ]" data-state="extrasmall">99+</p>
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
<a href="#">A link</a>
|
<a href="#">A link</a>
|
||||||
<a href="/">A visited link</a>
|
<a href="/">A visited link</a>
|
||||||
<hr />
|
<hr />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue