styles.scss 11 KB

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