excalidraw/src/components/ToolIcon.scss
Jed Fox 8e0206cc1e
Undo/Redo buttons, refactor menu toggles (#793)
* Make Undo & Redo and the menu buttons into actions; add undo/redo buttons

* Create variables for the ToolIcon colors

* Darken the menu buttons when they’re active

* Put the more intensive test in `perform`

* Fix & restyle hint viewer

* Add pinch zoom for macOS Safari

* Chrome/Firefox trackpad pinch zoom

* openedMenu → openMenu

* needsShapeEditor.ts → showSelectedShapeActions.ts

* Call showSelectedShapeActions
2020-03-01 20:39:03 +01:00

121 lines
2.1 KiB
SCSS

: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;
cursor: pointer;
background-color: var(--button-gray-1);
-webkit-tap-highlight-color: transparent;
}
.ToolIcon__icon {
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 {
font-family: var(--ui-font);
}
.ToolIcon_size_s .ToolIcon__icon {
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;
}