styles.scss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. @import "./variables.module";
  2. @import "./theme";
  3. :root {
  4. --zIndex-canvas: 1;
  5. --zIndex-wysiwyg: 2;
  6. --zIndex-layerUI: 3;
  7. }
  8. .excalidraw {
  9. position: relative;
  10. overflow: hidden;
  11. color: var(--text-primary-color);
  12. display: flex;
  13. top: 0;
  14. bottom: 0;
  15. left: 0;
  16. right: 0;
  17. height: 100%;
  18. width: 100%;
  19. button {
  20. cursor: pointer;
  21. }
  22. &:focus {
  23. outline: none;
  24. }
  25. // serves 2 purposes:
  26. // 1. prevent selecting text outside the component when double-clicking or
  27. // dragging inside it (e.g. on canvas)
  28. // 2. prevent selecting UI, both from the inside, and from outside the
  29. // component (e.g. if you select text in a sidebar)
  30. user-select: none;
  31. a {
  32. font-weight: 500;
  33. text-decoration: none;
  34. color: var(--link-color);
  35. &:hover {
  36. text-decoration: underline;
  37. }
  38. }
  39. canvas {
  40. touch-action: none;
  41. // following props improve blurriness at certain devicePixelRatios.
  42. // AFAIK it doesn't affect export (in fact, export seems sharp either way).
  43. image-rendering: pixelated; // chromium
  44. // NOTE: must be declared *after* the above
  45. image-rendering: -moz-crisp-edges; // FF
  46. z-index: var(--zIndex-canvas);
  47. // Remove the main canvas from document flow to avoid resizeObserver
  48. // feedback loop (see https://github.com/excalidraw/excalidraw/pull/3379)
  49. }
  50. &__canvas {
  51. position: absolute;
  52. }
  53. &.theme--dark {
  54. // The percentage is inspired by
  55. // https://material.io/design/color/dark-theme.html#properties, which
  56. // recommends surface color of #121212, 93% yields #111111 for #FFF
  57. canvas {
  58. filter: var(--theme-filter);
  59. }
  60. }
  61. .FixedSideContainer {
  62. padding-top: var(--sat, 0);
  63. padding-right: var(--sar, 0);
  64. padding-bottom: var(--sab, 0);
  65. padding-left: var(--sal, 0);
  66. }
  67. .panelRow {
  68. display: flex;
  69. justify-content: space-between;
  70. }
  71. .panelColumn {
  72. display: flex;
  73. flex-direction: column;
  74. row-gap: 0.75rem;
  75. h3,
  76. legend,
  77. .control-label {
  78. margin: 0;
  79. margin-bottom: 0.25rem;
  80. font-size: 0.75rem;
  81. color: var(--text-primary-color);
  82. font-weight: normal;
  83. display: block;
  84. }
  85. .control-label input {
  86. display: block;
  87. width: 100%;
  88. }
  89. legend {
  90. padding: 0;
  91. }
  92. .iconSelectList {
  93. flex-wrap: wrap;
  94. position: relative;
  95. }
  96. .buttonList {
  97. flex-wrap: wrap;
  98. display: flex;
  99. column-gap: 0.5rem;
  100. row-gap: 0.5rem;
  101. label {
  102. font-size: 0.75rem;
  103. }
  104. input[type="radio"],
  105. input[type="button"] {
  106. opacity: 0;
  107. position: absolute;
  108. pointer-events: none;
  109. }
  110. .iconRow {
  111. margin-top: 8px;
  112. }
  113. }
  114. fieldset {
  115. margin: 0;
  116. padding: 0;
  117. border: none;
  118. }
  119. }
  120. .divider {
  121. width: 1px;
  122. background-color: $oc-gray-2;
  123. margin: 1px;
  124. }
  125. .buttonList label:focus-within,
  126. input:focus-visible {
  127. outline: transparent;
  128. box-shadow: 0 0 0 2px var(--focus-highlight-color);
  129. }
  130. .buttonList {
  131. .ToolIcon__icon {
  132. all: unset !important;
  133. display: flex !important;
  134. }
  135. button {
  136. background-color: transparent;
  137. }
  138. label,
  139. button,
  140. .zIndexButton {
  141. @include outlineButtonStyles;
  142. padding: 0;
  143. svg {
  144. width: var(--default-icon-size);
  145. height: var(--default-icon-size);
  146. }
  147. }
  148. }
  149. .App-top-bar {
  150. z-index: var(--zIndex-layerUI);
  151. display: flex;
  152. flex-direction: column;
  153. align-items: center;
  154. }
  155. .App-bottom-bar {
  156. position: absolute;
  157. top: 0;
  158. bottom: 0;
  159. left: 0;
  160. right: 0;
  161. --bar-padding: calc(4 * var(--space-factor));
  162. padding-top: #{"max(var(--bar-padding), var(--sat,0))"};
  163. padding-right: var(--sar, 0);
  164. padding-bottom: var(--sab, 0);
  165. padding-left: var(--sal, 0);
  166. z-index: 4;
  167. display: flex;
  168. align-items: flex-end;
  169. pointer-events: none;
  170. > .Island {
  171. width: 100%;
  172. max-width: 100%;
  173. min-width: 100%;
  174. box-sizing: border-box;
  175. max-height: 100%;
  176. display: flex;
  177. flex-direction: column;
  178. pointer-events: initial;
  179. .panelColumn {
  180. padding: 8px 8px 0 8px;
  181. }
  182. }
  183. }
  184. .App-toolbar {
  185. width: 100%;
  186. .eraser {
  187. &.ToolIcon:hover {
  188. --icon-fill-color: #fff;
  189. --keybinding-color: #fff;
  190. }
  191. &.active {
  192. background-color: var(--color-primary);
  193. }
  194. }
  195. }
  196. .App-toolbar-content {
  197. display: flex;
  198. align-items: center;
  199. justify-content: space-between;
  200. padding: 8px;
  201. }
  202. .App-mobile-menu {
  203. width: 100%;
  204. overflow-x: visible;
  205. overflow-y: auto;
  206. box-sizing: border-box;
  207. margin-bottom: var(--bar-padding);
  208. }
  209. .App-menu {
  210. display: grid;
  211. color: var(--icon-fill-color);
  212. }
  213. .shapes-section {
  214. display: flex;
  215. justify-content: center;
  216. pointer-events: none !important;
  217. & > * {
  218. pointer-events: all;
  219. }
  220. }
  221. .App-menu_top {
  222. grid-template-columns: 1fr 2fr 1fr;
  223. grid-gap: 2rem;
  224. align-items: flex-start;
  225. cursor: default;
  226. pointer-events: none !important;
  227. @media (min-width: 1536px) {
  228. grid-template-columns: 1fr 1fr 1fr;
  229. grid-gap: 3rem;
  230. }
  231. }
  232. .layer-ui__wrapper:not(.disable-pointerEvents) .App-menu_top > * {
  233. pointer-events: all;
  234. }
  235. .App-menu_top > *:first-child {
  236. justify-self: flex-start;
  237. }
  238. .App-menu_top > *:last-child {
  239. justify-self: flex-end;
  240. }
  241. .App-menu_bottom {
  242. position: absolute;
  243. bottom: 1rem;
  244. display: flex;
  245. justify-content: space-between;
  246. align-items: flex-start;
  247. cursor: default;
  248. pointer-events: none !important;
  249. box-sizing: border-box;
  250. padding: 0 1rem;
  251. &--transition-left {
  252. section {
  253. width: 185px;
  254. }
  255. }
  256. section {
  257. display: flex;
  258. }
  259. }
  260. .App-menu_bottom > *:first-child {
  261. justify-self: flex-start;
  262. }
  263. .App-menu_bottom > *:last-child {
  264. justify-self: flex-end;
  265. }
  266. .App-menu_left {
  267. grid-template-rows: 1fr auto 1fr;
  268. height: 100%;
  269. }
  270. .App-menu_right {
  271. grid-template-rows: 1fr;
  272. height: 100%;
  273. }
  274. .App-menu__left {
  275. overflow-y: auto;
  276. padding: 0.75rem;
  277. width: 202px;
  278. box-sizing: border-box;
  279. position: absolute;
  280. }
  281. .dropdown-select {
  282. height: 1.5rem;
  283. padding: 0;
  284. padding-inline-start: 0.5rem;
  285. padding-inline-end: 1.5rem;
  286. color: var(--icon-fill-color);
  287. background-color: var(--button-gray-1);
  288. border-radius: var(--space-factor);
  289. border: 1px solid var(--button-gray-2);
  290. font-size: 0.8rem;
  291. outline: none;
  292. appearance: none;
  293. background-image: var(--dropdown-icon);
  294. background-repeat: no-repeat;
  295. background-position: right 0.7rem top 50%, 0 0;
  296. :root[dir="rtl"] & {
  297. background-position: left 0.7rem top 50%, 0 0;
  298. }
  299. background-size: 0.65em auto, 100%;
  300. &:focus {
  301. box-shadow: 0 0 0 2px var(--focus-highlight-color);
  302. }
  303. &:hover {
  304. background-color: var(--button-gray-2);
  305. }
  306. &:active {
  307. background-color: var(--button-gray-2);
  308. }
  309. &__language {
  310. height: 2rem;
  311. background-color: var(--island-bg-color);
  312. border-color: var(--default-border-color) !important;
  313. cursor: pointer;
  314. &:hover {
  315. background-color: var(--island-bg-color);
  316. }
  317. }
  318. }
  319. .disable-zen-mode {
  320. border-radius: var(--border-radius-lg);
  321. background-color: var(--color-gray-20);
  322. border: 1px solid var(--color-gray-30);
  323. padding: 10px 20px;
  324. &:hover {
  325. background-color: var(--color-gray-30);
  326. }
  327. }
  328. .scroll-back-to-content {
  329. border-radius: var(--border-radius-lg);
  330. background-color: var(--island-bg-color);
  331. color: var(--icon-fill-color);
  332. border: 1px solid var(--default-border-color);
  333. padding: 10px 20px;
  334. position: absolute;
  335. left: 50%;
  336. bottom: 30px;
  337. transform: translateX(-50%);
  338. pointer-events: all;
  339. &:hover {
  340. background-color: var(--button-hover-bg);
  341. }
  342. &:active {
  343. border: 1px solid var(--color-primary-darkest);
  344. }
  345. }
  346. .help-icon {
  347. @include outlineButtonStyles;
  348. background-color: var(--island-bg-color);
  349. width: var(--lg-button-size);
  350. height: var(--lg-button-size);
  351. svg {
  352. width: var(--lg-icon-size);
  353. height: var(--lg-icon-size);
  354. }
  355. }
  356. .reset-zoom-button {
  357. font-family: var(--ui-font);
  358. }
  359. .finalize-button {
  360. display: grid;
  361. grid-auto-flow: column;
  362. gap: 0.4em;
  363. margin-top: auto;
  364. margin-bottom: auto;
  365. margin-inline-start: 0.6em;
  366. }
  367. .undo-redo-buttons,
  368. .eraser-buttons {
  369. display: grid;
  370. grid-auto-flow: column;
  371. margin-top: auto;
  372. margin-bottom: auto;
  373. margin-inline-start: 0.6em;
  374. }
  375. @include isMobile {
  376. aside {
  377. display: none;
  378. }
  379. .scroll-back-to-content {
  380. bottom: calc(80px + var(--sab, 0));
  381. z-index: -1;
  382. }
  383. }
  384. .rtl-mirror {
  385. :root[dir="rtl"] & {
  386. transform: scaleX(-1);
  387. }
  388. }
  389. .zen-mode-visibility {
  390. visibility: visible;
  391. opacity: 1;
  392. height: auto;
  393. width: auto;
  394. transition: opacity 0.5s;
  395. &.zen-mode-visibility--hidden {
  396. visibility: hidden;
  397. opacity: 0;
  398. height: 0;
  399. width: 0;
  400. transition: opacity 0.5s;
  401. }
  402. }
  403. .disable-pointerEvents {
  404. pointer-events: none !important;
  405. }
  406. &.excalidraw--view-mode {
  407. .App-menu {
  408. display: flex;
  409. justify-content: space-between;
  410. }
  411. }
  412. input[type="text"],
  413. textarea:not(.excalidraw-wysiwyg) {
  414. color: var(--text-primary-color);
  415. border: 1.5px solid var(--input-border-color);
  416. padding: 0.75rem;
  417. white-space: nowrap;
  418. border-radius: var(--space-factor);
  419. background-color: var(--input-bg-color);
  420. &:not(:focus) {
  421. &:hover {
  422. background-color: var(--input-hover-bg-color);
  423. }
  424. }
  425. &:focus {
  426. outline: none;
  427. box-shadow: 0 0 0 2px var(--focus-highlight-color);
  428. }
  429. }
  430. @media print {
  431. .App-bottom-bar,
  432. .FixedSideContainer,
  433. .layer-ui__wrapper {
  434. display: none;
  435. }
  436. }
  437. // use custom, minimalistic scrollbar
  438. // (doesn't work in Firefox)
  439. ::-webkit-scrollbar {
  440. width: 3px;
  441. }
  442. ::-webkit-scrollbar-thumb {
  443. background: var(--scrollbar-thumb);
  444. border-radius: 10px;
  445. }
  446. ::-webkit-scrollbar-thumb:hover {
  447. background: var(--scrollbar-thumb-hover);
  448. }
  449. ::-webkit-scrollbar-thumb:active {
  450. background: var(--scrollbar-thumb);
  451. }
  452. .mobile-misc-tools-container {
  453. position: absolute;
  454. top: calc(5rem - var(--editor-container-padding));
  455. right: calc(var(--editor-container-padding) * -1);
  456. display: flex;
  457. flex-direction: column;
  458. border: 1px solid var(--sidebar-border-color);
  459. border-top-left-radius: var(--border-radius-lg);
  460. border-bottom-left-radius: var(--border-radius-lg);
  461. border-right: 0;
  462. overflow: hidden;
  463. background-color: var(--island-bg-color);
  464. .ToolIcon__icon {
  465. border-radius: 0;
  466. }
  467. .library-button {
  468. border: 0;
  469. }
  470. }
  471. .App-toolbar--mobile {
  472. overflow-x: hidden;
  473. max-width: 100vw;
  474. .ToolIcon__keybinding {
  475. display: none;
  476. }
  477. }
  478. .UserList-Wrapper {
  479. margin: 0;
  480. padding: 0;
  481. border: none;
  482. text-align: left;
  483. legend {
  484. display: block;
  485. font-size: 0.75rem;
  486. font-weight: 400;
  487. margin: 0 0 0.25rem;
  488. padding: 0;
  489. }
  490. }
  491. }
  492. .ErrorSplash.excalidraw {
  493. min-height: 100vh;
  494. padding: 20px 0;
  495. overflow: auto;
  496. display: flex;
  497. align-items: center;
  498. justify-content: center;
  499. user-select: text;
  500. .ErrorSplash-messageContainer {
  501. display: flex;
  502. flex-direction: column;
  503. align-items: center;
  504. justify-content: center;
  505. padding: 40px;
  506. background-color: $oc-red-1;
  507. border: 3px solid $oc-red-9;
  508. }
  509. .ErrorSplash-paragraph {
  510. margin: 15px 0;
  511. max-width: 600px;
  512. &.align-center {
  513. text-align: center;
  514. }
  515. }
  516. .bigger,
  517. .bigger button {
  518. font-size: 1.1em;
  519. }
  520. .smaller,
  521. .smaller button {
  522. font-size: 0.9em;
  523. }
  524. .ErrorSplash-details {
  525. display: flex;
  526. flex-direction: column;
  527. align-items: flex-start;
  528. textarea {
  529. width: 100%;
  530. margin: 10px 0;
  531. font-family: "Cascadia";
  532. font-size: 0.8em;
  533. }
  534. }
  535. }