2021-07-10 00:45:44 +00:00
|
|
|
import { css } from 'lit';
|
|
|
|
import componentStyles from '../../styles/component.styles';
|
2021-08-26 12:35:36 +00:00
|
|
|
import { focusVisibleSelector } from '../../internal/focus-visible';
|
2021-07-10 00:45:44 +00:00
|
|
|
|
|
|
|
export default css`
|
|
|
|
${componentStyles}
|
|
|
|
|
|
|
|
:host {
|
2021-08-06 12:32:46 +00:00
|
|
|
--symbol-color: rgb(var(--sl-color-neutral-300));
|
2021-08-18 21:54:35 +00:00
|
|
|
--symbol-color-active: rgb(var(--sl-color-amber-500));
|
2021-07-10 00:45:44 +00:00
|
|
|
--symbol-size: 1.2rem;
|
|
|
|
--symbol-spacing: var(--sl-spacing-xxx-small);
|
|
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
.rating {
|
|
|
|
position: relative;
|
|
|
|
display: inline-flex;
|
|
|
|
border-radius: var(--sl-border-radius-medium);
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
|
|
|
|
|
|
|
.rating:focus {
|
|
|
|
outline: none;
|
|
|
|
}
|
|
|
|
|
2021-08-26 12:35:36 +00:00
|
|
|
.rating${focusVisibleSelector} {
|
2021-08-10 21:53:15 +00:00
|
|
|
box-shadow: 0 0 0 var(--sl-focus-ring-width) rgb(var(--sl-color-primary-500) / var(--sl-focus-ring-alpha));
|
2021-07-10 00:45:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.rating__symbols {
|
|
|
|
display: inline-flex;
|
|
|
|
position: relative;
|
|
|
|
font-size: var(--symbol-size);
|
|
|
|
line-height: 0;
|
|
|
|
color: var(--symbol-color);
|
|
|
|
white-space: nowrap;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
|
|
|
.rating__symbols > * {
|
|
|
|
padding: var(--symbol-spacing);
|
|
|
|
}
|
|
|
|
|
|
|
|
.rating__symbols--indicator {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
color: var(--symbol-color-active);
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.rating__symbol {
|
|
|
|
transition: var(--sl-transition-fast) transform;
|
|
|
|
}
|
|
|
|
|
|
|
|
.rating__symbol--hover {
|
|
|
|
transform: scale(1.2);
|
|
|
|
}
|
|
|
|
|
|
|
|
.rating--disabled .rating__symbols,
|
|
|
|
.rating--readonly .rating__symbols {
|
|
|
|
cursor: default;
|
|
|
|
}
|
|
|
|
|
|
|
|
.rating--disabled .rating__symbol--hover .rating--readonly .rating__symbol--hover {
|
|
|
|
transform: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.rating--disabled {
|
|
|
|
opacity: 0.5;
|
|
|
|
}
|
|
|
|
|
|
|
|
.rating--disabled .rating__symbols {
|
|
|
|
cursor: not-allowed;
|
|
|
|
}
|
|
|
|
`;
|