aboutsummaryrefslogtreecommitdiffstats
path: root/packages/excalidraw/components/ContextMenu.scss
blob: 3bedf2ba7abc7d011ebc3db882f1124e2f870403 (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
@import "../css/variables.module.scss";

.excalidraw {
  .context-menu {
    position: relative;
    border-radius: 4px;
    box-shadow: 0 3px 10px transparentize($oc-black, 0.8);
    padding: 0;
    list-style: none;
    user-select: none;
    margin: -0.25rem 0 0 0.125rem;
    padding: 0.5rem 0;
    background-color: var(--popup-secondary-bg-color);
    border: 1px solid var(--button-gray-3);
    cursor: default;
  }

  .context-menu button {
    color: var(--popup-text-color);
  }

  .context-menu-item {
    position: relative;
    width: 100%;
    min-width: 9.5rem;
    margin: 0;
    padding: 0.25rem 1rem 0.25rem 1.25rem;
    text-align: start;
    border-radius: 0;
    background-color: transparent;
    border: none;
    white-space: nowrap;
    font-family: inherit;

    display: grid;
    grid-template-columns: 1fr 0.2fr;
    align-items: center;

    &.checkmark::before {
      position: absolute;
      left: 6px;
      margin-bottom: 1px;
      content: "\2713";
    }

    &.dangerous {
      .context-menu-item__label {
        color: $oc-red-7;
      }
    }

    .context-menu-item__label {
      justify-self: start;
      margin-inline-end: 20px;
    }
    .context-menu-item__shortcut {
      justify-self: end;
      opacity: 0.6;
      font-family: inherit;
      font-size: 0.7rem;
    }
  }

  .context-menu-item:hover {
    color: var(--popup-bg-color);
    background-color: var(--select-highlight-color);

    &.dangerous {
      .context-menu-item__label {
        color: var(--popup-bg-color);
      }
      background-color: $oc-red-6;
    }
  }

  .context-menu-item:focus {
    z-index: 1;
  }

  @include isMobile {
    .context-menu-item {
      display: block;

      .context-menu-item__label {
        margin-inline-end: 0;
      }

      .context-menu-item__shortcut {
        display: none;
      }
    }
  }

  .context-menu-item-separator {
    border: none;
    border-top: 1px solid $oc-gray-5;
  }
}