您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

styles.scss 11KB

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