refactor(ui): localize component styles
This commit is contained in:
@@ -143,4 +143,201 @@ component Alert {
|
||||
{/if}
|
||||
</section>
|
||||
}
|
||||
|
||||
style {
|
||||
.wire-next--alert {
|
||||
--wire-alert-color: var(--wire-component-color);
|
||||
--wire-alert-soft: color-mix(in srgb, var(--wire-alert-color) 16%, var(--wire-color-surface));
|
||||
display: grid;
|
||||
grid-template-columns: auto minmax(0, 1fr) auto;
|
||||
gap: 0.8rem;
|
||||
width: 100%;
|
||||
padding: 1rem;
|
||||
border: 1px solid transparent;
|
||||
border-radius: var(--wire-radius, 0.75rem);
|
||||
color: var(--wire-color-text);
|
||||
}
|
||||
|
||||
.wire-next--alert[data-radius="none"] {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.wire-next--alert[data-radius="sm"] {
|
||||
border-radius: var(--wire-radius-sm, 0.375rem);
|
||||
}
|
||||
|
||||
.wire-next--alert[data-radius="lg"] {
|
||||
border-radius: calc(var(--wire-radius, 0.75rem) * 1.35);
|
||||
}
|
||||
|
||||
.wire-next--alert[data-radius="xl"] {
|
||||
border-radius: calc(var(--wire-radius, 0.75rem) * 1.75);
|
||||
}
|
||||
|
||||
.wire-next--alert[data-shadow="none"] {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.wire-next--alert[data-shadow="sm"] {
|
||||
box-shadow: 0 6px 16px color-mix(in srgb, #000 14%, transparent);
|
||||
}
|
||||
|
||||
.wire-next--alert[data-shadow="md"] {
|
||||
box-shadow:
|
||||
0 2px 6px color-mix(in srgb, #000 10%, transparent),
|
||||
0 12px 28px color-mix(in srgb, #000 18%, transparent);
|
||||
}
|
||||
|
||||
.wire-next--alert[data-shadow="lg"] {
|
||||
box-shadow:
|
||||
0 4px 10px color-mix(in srgb, #000 12%, transparent),
|
||||
0 20px 48px color-mix(in srgb, #000 24%, transparent);
|
||||
}
|
||||
|
||||
.wire-next--alert[data-color="secondary"] {
|
||||
--wire-alert-color: #737373;
|
||||
}
|
||||
|
||||
.wire-next--alert[data-color="success"] {
|
||||
--wire-alert-color: #0f9f8f;
|
||||
}
|
||||
|
||||
.wire-next--alert[data-color="danger"] {
|
||||
--wire-alert-color: #dc3545;
|
||||
}
|
||||
|
||||
.wire-next--alert[data-color="warning"] {
|
||||
--wire-alert-color: #eab308;
|
||||
}
|
||||
|
||||
.wire-next--alert[data-color="info"] {
|
||||
--wire-alert-color: #2563eb;
|
||||
}
|
||||
|
||||
.wire-next--alert[data-color="dark"] {
|
||||
--wire-alert-color: #27272a;
|
||||
}
|
||||
|
||||
.wire-next--alert[data-color="light"] {
|
||||
--wire-alert-color: #f4f4f5;
|
||||
}
|
||||
|
||||
.wire-next--alert-compact {
|
||||
padding: 0.75rem 0.9rem;
|
||||
}
|
||||
|
||||
.wire-next--alert-compact:not(:has(.wire-next__alert-icon)):not(:has(.wire-next__alert-dismiss)) {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.wire-next--alert-compact .wire-next__alert-body {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.wire-next--alert-compact .wire-next__alert-title {
|
||||
margin-right: 0.25rem;
|
||||
}
|
||||
|
||||
.wire-next--alert-compact .wire-next__alert-body > p {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.wire-next__alert-icon {
|
||||
display: inline-grid;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
place-items: center;
|
||||
margin-top: 0.05rem;
|
||||
color: var(--wire-alert-color);
|
||||
}
|
||||
|
||||
.wire-next__alert-icon > span {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
}
|
||||
|
||||
.wire-next__alert-body {
|
||||
display: grid;
|
||||
min-width: 0;
|
||||
gap: 0.35rem;
|
||||
}
|
||||
|
||||
.wire-next__alert-title {
|
||||
font-size: 0.88rem;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.wire-next__alert-body > p,
|
||||
.wire-next__alert-body li {
|
||||
color: inherit;
|
||||
font-size: 0.8rem;
|
||||
line-height: 1.55;
|
||||
}
|
||||
|
||||
.wire-next__alert-body > ul {
|
||||
display: grid;
|
||||
gap: 0.25rem;
|
||||
margin: 0.15rem 0 0;
|
||||
padding-left: 1.25rem;
|
||||
}
|
||||
|
||||
.wire-next__alert-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem 1rem;
|
||||
margin-top: 0.35rem;
|
||||
}
|
||||
|
||||
.wire-next__alert-actions a {
|
||||
color: var(--wire-alert-color);
|
||||
font-size: 0.78rem;
|
||||
font-weight: 700;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.wire-next__alert-actions a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.wire-next__alert-actions a[data-variant="action"] {
|
||||
padding: 0.35rem 0.6rem;
|
||||
border-radius: var(--wire-radius-sm);
|
||||
background: var(--wire-alert-color);
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.wire-next__alert-dismiss {
|
||||
display: inline-grid;
|
||||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
place-items: center;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: var(--wire-radius-sm);
|
||||
background: transparent;
|
||||
color: currentColor;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.wire-next__alert-dismiss:hover {
|
||||
background: color-mix(in srgb, currentColor 10%, transparent);
|
||||
}
|
||||
|
||||
.wire-next__alert-dismiss:focus-visible {
|
||||
outline: 2px solid currentColor;
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
@media (max-width: 36rem) {
|
||||
.wire-next--alert {
|
||||
grid-template-columns: auto minmax(0, 1fr);
|
||||
}
|
||||
.wire-next__alert-dismiss {
|
||||
grid-column: 2;
|
||||
grid-row: 1;
|
||||
justify-self: end;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user