- show a circle colored by the first 6 hex digits of the uuid, bordered with the badge text color for contrast in both themes - lighten the uuid badge background on hover - let Badge accept a className - add a storybook story with six sample uuids and a randomize button - bump version to 1.21.0
56 lines
1.1 KiB
CSS
56 lines
1.1 KiB
CSS
.wrapper {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
position: relative;
|
|
}
|
|
|
|
.badge {
|
|
transition: background var(--transition);
|
|
}
|
|
|
|
.badge:hover {
|
|
background: color-mix(in srgb, var(--color-neutral-bg) 85%, white);
|
|
}
|
|
|
|
.swatch {
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
border: 1px solid currentColor;
|
|
box-sizing: border-box;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.button {
|
|
all: unset;
|
|
cursor: pointer;
|
|
font: inherit;
|
|
color: inherit;
|
|
letter-spacing: 0.02em;
|
|
}
|
|
|
|
.button:focus-visible {
|
|
outline: 2px solid var(--color-focus-ring);
|
|
outline-offset: 2px;
|
|
border-radius: var(--radius-sm);
|
|
}
|
|
|
|
.pop {
|
|
position: absolute;
|
|
left: calc(100% + 4px);
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
display: inline-flex;
|
|
align-items: center;
|
|
color: var(--color-success-fg);
|
|
animation: popFade 1s ease forwards;
|
|
pointer-events: none;
|
|
}
|
|
|
|
@keyframes popFade {
|
|
0% { opacity: 0; transform: translateY(calc(-50% - 4px)); }
|
|
20% { opacity: 1; transform: translateY(-50%); }
|
|
70% { opacity: 1; transform: translateY(-50%); }
|
|
100% { opacity: 0; transform: translateY(calc(-50% - 4px)); }
|
|
}
|