123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640 |
- @import "./variables.module";
- @import "./theme";
- :root {
- --zIndex-canvas: 1;
- --zIndex-wysiwyg: 2;
- --zIndex-layerUI: 3;
- }
- .excalidraw {
- position: relative;
- overflow: hidden;
- color: var(--text-primary-color);
- display: flex;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- height: 100%;
- width: 100%;
- button {
- cursor: pointer;
- }
- &:focus {
- outline: none;
- }
- // serves 2 purposes:
- // 1. prevent selecting text outside the component when double-clicking or
- // dragging inside it (e.g. on canvas)
- // 2. prevent selecting UI, both from the inside, and from outside the
- // component (e.g. if you select text in a sidebar)
- user-select: none;
- a {
- font-weight: 500;
- text-decoration: none;
- color: var(--link-color);
- &:hover {
- text-decoration: underline;
- }
- }
- canvas {
- touch-action: none;
- // following props improve blurriness at certain devicePixelRatios.
- // AFAIK it doesn't affect export (in fact, export seems sharp either way).
- image-rendering: pixelated; // chromium
- // NOTE: must be declared *after* the above
- image-rendering: -moz-crisp-edges; // FF
- z-index: var(--zIndex-canvas);
- // Remove the main canvas from document flow to avoid resizeObserver
- // feedback loop (see https://github.com/excalidraw/excalidraw/pull/3379)
- }
- &__canvas {
- position: absolute;
- }
- &.theme--dark {
- // The percentage is inspired by
- // https://material.io/design/color/dark-theme.html#properties, which
- // recommends surface color of #121212, 93% yields #111111 for #FFF
- canvas {
- filter: var(--theme-filter);
- }
- }
- .FixedSideContainer {
- padding-top: var(--sat, 0);
- padding-right: var(--sar, 0);
- padding-bottom: var(--sab, 0);
- padding-left: var(--sal, 0);
- }
- .panelRow {
- display: flex;
- justify-content: space-between;
- }
- .panelColumn {
- display: flex;
- flex-direction: column;
- row-gap: 0.75rem;
- h3,
- legend,
- .control-label {
- margin: 0;
- margin-bottom: 0.25rem;
- font-size: 0.75rem;
- color: var(--text-primary-color);
- font-weight: normal;
- display: block;
- }
- .control-label input {
- display: block;
- width: 100%;
- }
- legend {
- padding: 0;
- }
- .iconSelectList {
- flex-wrap: wrap;
- position: relative;
- }
- .buttonList {
- flex-wrap: wrap;
- display: flex;
- column-gap: 0.5rem;
- row-gap: 0.5rem;
- label {
- font-size: 0.75rem;
- }
- input[type="radio"],
- input[type="button"] {
- opacity: 0;
- position: absolute;
- pointer-events: none;
- }
- .iconRow {
- margin-top: 8px;
- }
- }
- fieldset {
- margin: 0;
- padding: 0;
- border: none;
- }
- }
- .divider {
- width: 1px;
- background-color: $oc-gray-2;
- margin: 1px;
- }
- .buttonList label:focus-within,
- input:focus-visible {
- outline: transparent;
- box-shadow: 0 0 0 2px var(--focus-highlight-color);
- }
- .buttonList {
- .ToolIcon__icon {
- all: unset !important;
- display: flex !important;
- }
- button {
- background-color: transparent;
- }
- label,
- button,
- .zIndexButton {
- @include outlineButtonStyles;
- padding: 0;
- svg {
- width: var(--default-icon-size);
- height: var(--default-icon-size);
- }
- }
- }
- .App-top-bar {
- z-index: var(--zIndex-layerUI);
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .App-bottom-bar {
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- --bar-padding: calc(4 * var(--space-factor));
- padding-top: #{"max(var(--bar-padding), var(--sat,0))"};
- padding-right: var(--sar, 0);
- padding-bottom: var(--sab, 0);
- padding-left: var(--sal, 0);
- z-index: 4;
- display: flex;
- align-items: flex-end;
- pointer-events: none;
- > .Island {
- width: 100%;
- max-width: 100%;
- min-width: 100%;
- box-sizing: border-box;
- max-height: 100%;
- display: flex;
- flex-direction: column;
- pointer-events: initial;
- .panelColumn {
- padding: 8px 8px 0 8px;
- }
- }
- }
- .App-toolbar {
- width: 100%;
- .eraser {
- &.ToolIcon:hover {
- --icon-fill-color: #fff;
- --keybinding-color: #fff;
- }
- &.active {
- background-color: var(--color-primary);
- }
- }
- }
- .App-toolbar-content {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 8px;
- }
- .App-mobile-menu {
- width: 100%;
- overflow-x: visible;
- overflow-y: auto;
- box-sizing: border-box;
- margin-bottom: var(--bar-padding);
- }
- .App-menu {
- display: grid;
- color: var(--icon-fill-color);
- }
- .shapes-section {
- display: flex;
- justify-content: center;
- pointer-events: none !important;
- & > * {
- pointer-events: all;
- }
- }
- .App-menu_top {
- grid-template-columns: 1fr 2fr 1fr;
- grid-gap: 2rem;
- align-items: flex-start;
- cursor: default;
- pointer-events: none !important;
- @media (min-width: 1536px) {
- grid-template-columns: 1fr 1fr 1fr;
- grid-gap: 3rem;
- }
- }
- .layer-ui__wrapper:not(.disable-pointerEvents) .App-menu_top > * {
- pointer-events: all;
- }
- .App-menu_top > *:first-child {
- justify-self: flex-start;
- }
- .App-menu_top > *:last-child {
- justify-self: flex-end;
- }
- .App-menu_bottom {
- position: absolute;
- bottom: 1rem;
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- cursor: default;
- pointer-events: none !important;
- box-sizing: border-box;
- padding: 0 1rem;
- &--transition-left {
- section {
- width: 185px;
- }
- }
- section {
- display: flex;
- }
- }
- .App-menu_bottom > *:first-child {
- justify-self: flex-start;
- }
- .App-menu_bottom > *:last-child {
- justify-self: flex-end;
- }
- .App-menu_left {
- grid-template-rows: 1fr auto 1fr;
- height: 100%;
- }
- .App-menu_right {
- grid-template-rows: 1fr;
- height: 100%;
- }
- .App-menu__left {
- overflow-y: auto;
- padding: 0.75rem;
- width: 202px;
- box-sizing: border-box;
- position: absolute;
- }
- .dropdown-select {
- height: 1.5rem;
- padding: 0;
- padding-inline-start: 0.5rem;
- padding-inline-end: 1.5rem;
- color: var(--icon-fill-color);
- background-color: var(--button-gray-1);
- border-radius: var(--space-factor);
- border: 1px solid var(--button-gray-2);
- font-size: 0.8rem;
- outline: none;
- appearance: none;
- background-image: var(--dropdown-icon);
- background-repeat: no-repeat;
- background-position: right 0.7rem top 50%, 0 0;
- :root[dir="rtl"] & {
- background-position: left 0.7rem top 50%, 0 0;
- }
- background-size: 0.65em auto, 100%;
- &:focus {
- box-shadow: 0 0 0 2px var(--focus-highlight-color);
- }
- &:hover {
- background-color: var(--button-gray-2);
- }
- &:active {
- background-color: var(--button-gray-2);
- }
- &__language {
- height: 2rem;
- background-color: var(--island-bg-color);
- border-color: var(--default-border-color) !important;
- cursor: pointer;
- &:hover {
- background-color: var(--island-bg-color);
- }
- }
- }
- .disable-zen-mode {
- border-radius: var(--border-radius-lg);
- background-color: var(--color-gray-20);
- border: 1px solid var(--color-gray-30);
- padding: 10px 20px;
- &:hover {
- background-color: var(--color-gray-30);
- }
- }
- .scroll-back-to-content {
- border-radius: var(--border-radius-lg);
- background-color: var(--island-bg-color);
- color: var(--icon-fill-color);
- border: 1px solid var(--default-border-color);
- padding: 10px 20px;
- position: absolute;
- left: 50%;
- bottom: 30px;
- transform: translateX(-50%);
- pointer-events: all;
- &:hover {
- background-color: var(--button-hover-bg);
- }
- &:active {
- border: 1px solid var(--color-primary-darkest);
- }
- }
- .help-icon {
- @include outlineButtonStyles;
- background-color: var(--island-bg-color);
- width: var(--lg-button-size);
- height: var(--lg-button-size);
- svg {
- width: var(--lg-icon-size);
- height: var(--lg-icon-size);
- }
- }
- .reset-zoom-button {
- font-family: var(--ui-font);
- }
- .finalize-button {
- display: grid;
- grid-auto-flow: column;
- gap: 0.4em;
- margin-top: auto;
- margin-bottom: auto;
- margin-inline-start: 0.6em;
- }
- .undo-redo-buttons,
- .eraser-buttons {
- display: grid;
- grid-auto-flow: column;
- margin-top: auto;
- margin-bottom: auto;
- margin-inline-start: 0.6em;
- }
- @include isMobile {
- aside {
- display: none;
- }
- .scroll-back-to-content {
- bottom: calc(80px + var(--sab, 0));
- z-index: -1;
- }
- }
- .rtl-mirror {
- :root[dir="rtl"] & {
- transform: scaleX(-1);
- }
- }
- .zen-mode-visibility {
- visibility: visible;
- opacity: 1;
- height: auto;
- width: auto;
- transition: opacity 0.5s;
- &.zen-mode-visibility--hidden {
- visibility: hidden;
- opacity: 0;
- height: 0;
- width: 0;
- transition: opacity 0.5s;
- }
- }
- .disable-pointerEvents {
- pointer-events: none !important;
- }
- &.excalidraw--view-mode {
- .App-menu {
- display: flex;
- justify-content: space-between;
- }
- }
- input[type="text"],
- textarea:not(.excalidraw-wysiwyg) {
- color: var(--text-primary-color);
- border: 1.5px solid var(--input-border-color);
- padding: 0.75rem;
- white-space: nowrap;
- border-radius: var(--space-factor);
- background-color: var(--input-bg-color);
- &:not(:focus) {
- &:hover {
- background-color: var(--input-hover-bg-color);
- }
- }
- &:focus {
- outline: none;
- box-shadow: 0 0 0 2px var(--focus-highlight-color);
- }
- }
- @media print {
- .App-bottom-bar,
- .FixedSideContainer,
- .layer-ui__wrapper {
- display: none;
- }
- }
- // use custom, minimalistic scrollbar
- // (doesn't work in Firefox)
- ::-webkit-scrollbar {
- width: 3px;
- }
- ::-webkit-scrollbar-thumb {
- background: var(--scrollbar-thumb);
- border-radius: 10px;
- }
- ::-webkit-scrollbar-thumb:hover {
- background: var(--scrollbar-thumb-hover);
- }
- ::-webkit-scrollbar-thumb:active {
- background: var(--scrollbar-thumb);
- }
- .mobile-misc-tools-container {
- position: absolute;
- top: calc(5rem - var(--editor-container-padding));
- right: calc(var(--editor-container-padding) * -1);
- display: flex;
- flex-direction: column;
- border: 1px solid var(--sidebar-border-color);
- border-top-left-radius: var(--border-radius-lg);
- border-bottom-left-radius: var(--border-radius-lg);
- border-right: 0;
- overflow: hidden;
- background-color: var(--island-bg-color);
- .ToolIcon__icon {
- border-radius: 0;
- }
- .library-button {
- border: 0;
- }
- }
- .App-toolbar--mobile {
- overflow-x: hidden;
- max-width: 100vw;
- .ToolIcon__keybinding {
- display: none;
- }
- }
- .UserList-Wrapper {
- margin: 0;
- padding: 0;
- border: none;
- text-align: left;
- legend {
- display: block;
- font-size: 0.75rem;
- font-weight: 400;
- margin: 0 0 0.25rem;
- padding: 0;
- }
- }
- }
- .ErrorSplash.excalidraw {
- min-height: 100vh;
- padding: 20px 0;
- overflow: auto;
- display: flex;
- align-items: center;
- justify-content: center;
- user-select: text;
- .ErrorSplash-messageContainer {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 40px;
- background-color: $oc-red-1;
- border: 3px solid $oc-red-9;
- }
- .ErrorSplash-paragraph {
- margin: 15px 0;
- max-width: 600px;
- &.align-center {
- text-align: center;
- }
- }
- .bigger,
- .bigger button {
- font-size: 1.1em;
- }
- .smaller,
- .smaller button {
- font-size: 0.9em;
- }
- .ErrorSplash-details {
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- textarea {
- width: 100%;
- margin: 10px 0;
- font-family: "Cascadia";
- font-size: 0.8em;
- }
- }
- }
|