aboutsummaryrefslogtreecommitdiffstats
path: root/packages/excalidraw/components/LayerUI.scss
blob: 36153d72b5f839cd4346516f2a538339494c2fc3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@import "open-color/open-color";
@import "../css/variables.module.scss";

.excalidraw {
  .layer-ui__wrapper.animate {
    transition: width 0.1s ease-in-out;
  }
  .layer-ui__wrapper {
    // when the rightside sidebar is docked, we need to resize the UI by its
    // width, making the nested UI content shift to the left. To do this,
    // we need the UI container to actually have dimensions set, but
    // then we also need to disable pointer events else the canvas below
    // wouldn't be interactive.
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--zIndex-layerUI);

    &__top-right {
      display: flex;
      width: 100%;
      justify-content: flex-end;
      gap: 0.75rem;
      pointer-events: none !important;

      & > * {
        pointer-events: var(--ui-pointerEvents);
      }
    }

    &__footer {
      width: 100%;

      &-right {
        z-index: 100;
        display: flex;
      }
    }

    .zen-mode-transition {
      transition: transform 0.5s ease-in-out;

      :root[dir="ltr"] &.transition-left {
        transform: translate(-999px, 0);
      }

      :root[dir="ltr"] &.transition-right {
        transform: translate(999px, 0);
      }

      :root[dir="rtl"] &.transition-left {
        transform: translate(999px, 0);
      }

      :root[dir="rtl"] &.transition-right {
        transform: translate(-999px, 0);
      }

      &.layer-ui__wrapper__footer-left--transition-bottom {
        transform: translate(0, 92px);
      }
    }

    .disable-zen-mode {
      padding: 10px;
      position: absolute;
      bottom: 0;
      [dir="ltr"] & {
        right: 1rem;
      }
      [dir="rtl"] & {
        left: 1rem;
      }
      opacity: 0;
      visibility: hidden;
      transition: visibility 0s linear 0s, opacity 0.5s;

      font-family: var(--ui-font);
      font-size: 0.75rem;
      font-weight: 500;
      line-height: 1;

      border-radius: var(--border-radius-lg);
      border: 1px solid var(--default-border-color);
      background-color: var(--island-bg-color);
      color: var(--text-primary-color);

      &:hover {
        background-color: var(--button-hover-bg);
      }
      &:active {
        border-color: var(--color-primary);
      }

      &--visible {
        opacity: 1;
        visibility: visible;
        transition: visibility 0s linear 300ms, opacity 0.5s;
        transition-delay: 0.8s;

        pointer-events: var(--ui-pointerEvents);
      }
    }

    .layer-ui__wrapper__footer-left,
    .footer-center,
    .layer-ui__wrapper__footer-right {
      & > * {
        pointer-events: var(--ui-pointerEvents);
      }
    }

    .layer-ui__wrapper__footer-right {
      margin-top: auto;
      margin-bottom: auto;
    }
  }
}