@kelvininc/ui-components
Version:
Kelvin UI Components
144 lines (138 loc) • 4.1 kB
CSS
/** HEADINGS **/
/** LABELS **/
/** SPANS **/
/** PARAGRAPHS **/
/** CODE/CONSOLE **/
@property --rotation {
syntax: "<angle>";
initial-value: 0deg;
inherits: false;
}
@keyframes rotate-border {
to {
--rotation: 360deg;
}
}
/** HEADINGS **/
/** LABELS **/
/** SPANS **/
/** PARAGRAPHS **/
/** CODE/CONSOLE **/
@property --rotation {
syntax: "<angle>";
initial-value: 0deg;
inherits: false;
}
@keyframes rotate-border {
to {
--rotation: 360deg;
}
}
:host {
/**
* @prop --range-width: Width of the range slider
* @prop --range-height: Height of the range slider
* @prop --range-selector-radius: Radius of the range thumb
* @prop --range-selector-border-radius: Border radius of the range thumb
* @prop --range-margin-top: Margin top of the range slider
* @prop --slider-background-filled: color of the slider when its full
* @prop --slider-background-filled-disabled: color of the slider when its disabled and full
* @prop --slider-background-empty: color of the slider when its empty
* @prop --thumb-background-color: thumb background color
* @prop --thumb-border-color: thumb border color
* @prop --range-label-color: range labels color
* @prop --select-label-color: select labels color
* @prop --select-label-disabled-color: disabled select labels color
*/
--range-width: 100%;
--range-height: 10px;
--range-selector-radius: 20px;
--select-label-disabled-color: var(--kv-neutral-5, #707070);
--slider-background-filled-disabled: var(--kv-neutral-5, #707070);
}
.range-container {
width: var(--range-width);
margin-top: var(--range-margin-top, calc(var(--range-selector-radius) * 0.5));
position: relative;
}
.range-container.has-label {
margin-top: 49px;
}
.range-min-max {
font-family: var(--kv-primary-font, "proxima-nova", sans-serif, "Arial");
font-size: 14px;
font-weight: 400;
font-stretch: normal;
font-style: normal;
line-height: 21px;
letter-spacing: normal;
text-transform: none;
width: 100%;
display: flex;
justify-content: space-between;
margin-top: var(--kv-spacing, 4px);
user-select: none;
color: var(--range-label-color);
}
.slider {
width: calc(var(--range-width) - 2px);
height: var(--range-height);
outline: none;
margin: 0;
border-radius: 6px;
user-select: none;
background: var(--slider-background-empty);
border: 1px solid var(--slider-background-empty);
}
.slider::-webkit-slider-thumb {
border: var(--range-selector-border-radius, calc(var(--kv-spacing, 4px) - 1px)) solid var(--thumb-border-color);
background: var(--thumb-background-color, var(--slider-background-filled));
height: calc(var(--range-selector-radius) + 5px);
width: calc(var(--range-selector-radius) + 5px);
border-radius: 50%;
cursor: pointer;
appearance: none;
}
.slider::-moz-range-thumb {
border: var(--range-selector-border-radius, var(--kv-spacing, 4px)) solid var(--thumb-border-color);
background: var(--thumb-background-color, var(--slider-background-filled));
height: var(--range-selector-radius);
width: var(--range-selector-radius);
border-radius: 50%;
cursor: pointer;
appearance: none;
}
.slider:disabled::-webkit-slider-thumb {
cursor: not-allowed;
user-select: none;
background: var(--slider-background-filled-disabled);
}
.select-value {
font-family: var(--kv-primary-font, "proxima-nova", sans-serif, "Arial");
font-size: 24px;
font-weight: 600;
font-stretch: normal;
font-style: normal;
line-height: 36px;
letter-spacing: normal;
text-transform: none;
top: -49px;
transform: translateX(-50%);
position: absolute;
background-color: transparent;
text-align: center;
color: var(--select-label-color);
}
.select-value.disabled {
color: var(--select-label-disabled-color);
}
input {
appearance: none;
}
:host {
--slider-background-filled: var(--kv-primary, #005cc7);
--slider-background-empty: var(--kv-neutral-3, #ddd);
--thumb-border-color: var(--kv-primary, #005cc7);
--range-label-color: var(--kv-neutral-5, #707070);
--select-label-color: var(--kv-neutral-5, #707070);
}