excalidraw/src/components/ToolIcon.scss

129 lines
2.2 KiB
SCSS
Raw Normal View History

:root {
--button-gray-1: #e9ecef;
--button-gray-2: #ced4da;
--button-gray-3: #adb5bd;
--button-blue: #a5d8ff;
}
.ToolIcon {
display: inline-flex;
align-items: center;
position: relative;
font-family: Cascadia;
2020-01-21 23:07:09 +02:00
cursor: pointer;
background-color: var(--button-gray-1);
-webkit-tap-highlight-color: transparent;
border-radius: var(--space-factor);
}
.ToolIcon__icon {
2020-01-20 19:59:00 -03:00
width: 2.5rem;
height: 2.5rem;
display: flex;
justify-content: center;
align-items: center;
border-radius: var(--space-factor);
svg {
position: relative;
height: 1em;
}
& + .ToolIcon__label {
margin-left: 0;
}
}
.ToolIcon__label {
font-family: var(--ui-font);
margin: 0 0.8em;
text-overflow: ellipsis;
}
.ToolIcon_size_s .ToolIcon__icon {
2020-01-20 19:59:00 -03:00
width: 1.4rem;
height: 1.4rem;
font-size: 0.8em;
}
.ToolIcon_type_button {
padding: 0;
border: none;
margin: 0;
font-size: inherit;
&:hover {
background-color: var(--button-gray-1);
}
&:active {
background-color: var(--button-gray-2);
}
&:focus {
box-shadow: 0 0 0 2px var(--button-blue);
}
&.ToolIcon--selected {
background-color: var(--button-gray-2);
&:active {
background-color: var(--button-gray-3);
}
}
}
.ToolIcon_type_radio,
.ToolIcon_type_checkbox {
position: absolute;
opacity: 0;
pointer-events: none;
&:checked + .ToolIcon__icon {
background-color: var(--button-gray-2);
}
&:focus + .ToolIcon__icon {
box-shadow: 0 0 0 2px var(--button-blue);
}
&:active + .ToolIcon__icon {
background-color: var(--button-gray-3);
}
}
.ToolIcon_type_floating {
background-color: transparent;
&:hover {
background-color: transparent;
}
&:active {
background-color: transparent;
}
&:focus {
box-shadow: none;
}
.ToolIcon__icon {
width: 2rem;
height: 2em;
}
}
.ToolIcon.ToolIcon__lock {
&.ToolIcon_type_button {
border-radius: 4px;
svg {
position: static;
}
}
&.ToolIcon_type_floating {
margin-left: 0.1rem;
}
}
.ToolIcon__keybinding {
position: absolute;
bottom: 2px;
right: 3px;
font-size: 0.5em;
color: var(--button-gray-3); // OC GRAY 5
font-family: var(--ui-font);
user-select: none;
}