Create reusable topic chip component
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/head This commit looks good
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
:host {
|
||||
display: inline-flex;
|
||||
width: fit-content;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.topic-chip__button {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
color: inherit;
|
||||
font-family: inherit;
|
||||
line-height: 1.25;
|
||||
cursor: pointer;
|
||||
|
||||
&:disabled {
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
||||
:host(.topic-chip--normal) .topic-chip__button {
|
||||
column-gap: 8px;
|
||||
min-height: 34px;
|
||||
padding: 6px 10px;
|
||||
border: 1px solid var(--topic-border);
|
||||
border-radius: 8px;
|
||||
background: var(--topic-bg);
|
||||
color: var(--topic-color);
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
transition:
|
||||
transform 0.15s ease,
|
||||
box-shadow 0.15s ease;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
:host(.topic-chip--mini) .topic-chip__button {
|
||||
column-gap: 5px;
|
||||
padding: 4px 7px;
|
||||
border: 0;
|
||||
border-radius: 7px;
|
||||
background: #f2f6ff;
|
||||
color: #40506f;
|
||||
font-size: 11px;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
color: var(--accent);
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
:host(.topic-chip--active.topic-chip--normal) .topic-chip__button {
|
||||
border-color: var(--topic-color);
|
||||
box-shadow: 0 0 0 2px color-mix(in srgb, var(--topic-color) 18%, transparent);
|
||||
}
|
||||
|
||||
:host(.topic-chip--active.topic-chip--mini) .topic-chip__button {
|
||||
background: #eaf1ff;
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.topic-chip__label {
|
||||
min-width: 0;
|
||||
text-align: center;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.topic-chip__count {
|
||||
display: inline-flex;
|
||||
flex: 0 0 auto;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 2px;
|
||||
min-width: 18px;
|
||||
height: 18px;
|
||||
padding: 0 5px;
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.78);
|
||||
color: inherit;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
:host(.topic-chip--mini) .topic-chip__count {
|
||||
min-width: 0;
|
||||
height: auto;
|
||||
padding: 0;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
color: var(--accent);
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.topic-chip__count-icon {
|
||||
width: 13px;
|
||||
height: 13px;
|
||||
font-size: 13px;
|
||||
line-height: 1;
|
||||
}
|
||||
Reference in New Issue
Block a user