File: _FeatureHighlight.scss

package info (click to toggle)
firefox 147.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,683,532 kB
  • sloc: cpp: 7,607,356; javascript: 6,533,348; ansic: 3,775,236; python: 1,415,508; xml: 634,561; asm: 438,949; java: 186,241; sh: 62,760; makefile: 18,079; objc: 13,092; perl: 12,808; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10; exp: 6
file content (156 lines) | stat: -rw-r--r-- 3,829 bytes parent folder | download | duplicates (3)
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
.feature-highlight {
  position: relative;
  // This is needed because in 1 case this is positioned under a link
  // and in an element that's not clickable.
  pointer-events: auto;
  z-index: 1;

  .feature-highlight-modal {
    position: absolute;
    display: flex;
    opacity: 0;
    visibility: hidden;
    cursor: default;
    justify-content: space-between;
    border-radius: var(--border-radius-small);
    background: var(--newtab-background-color-secondary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 15%);
    width: 298px;
    transition:
      opacity 0.3s,
      visibility 0.3s;

    // The "Dismiss" button in the top right corner of the highlight
    > moz-button {
      margin-inline-start: var(--space-xsmall);
      // Make sure the focus outline is not overlapped by the arrow
      // if the arrow is positioned near the button
      z-index: 1;
    }

    .message-icon {
      margin-block: var(--space-large);
      margin-inline: var(--space-large) var(--space-medium);
    }

    &.opened {
      opacity: 1;
      visibility: visible;
    }

    &::after {
      content: '';
      position: absolute;
      height: 24px;
      width: 24px;
      background: var(--newtab-background-color-secondary);
      box-shadow: 4px 4px 6px -2px rgba(0, 0, 0, 15%);
    }

    &.inset-block-start {
      inset-block-end: 100%;
      margin-block-end: var(--space-xlarge);

      &::after {
        inset-block-end: calc(var(--space-medium) * -1);
        transform: rotate(45deg);
      }

      &:dir(rtl)::after  {
        transform: rotate(225deg);
      }
    }

    &.inset-block-end {
      inset-block-start: 100%;
      margin-block-start: var(--space-xlarge);

      &::after {
        inset-block-start: calc(var(--space-medium) * -1);
        transform: rotate(225deg);
      }
    }

    &.inset-inline-start {
      inset-inline-end: calc(var(--space-xxlarge) * -1);

      &::after {
        inset-inline-end: calc(var(--space-xxlarge) - var(--space-medium));
      }
    }

    &.inset-inline-center {
      transform: translateX(-50%);
      inset-inline-start: 50%;

      &:dir(rtl) {
        transform: translateX(50%);
      }
    }

    &.inset-inline-end {
      inset-inline-start: calc(var(--space-xxlarge) * -1);

      &::after {
        inset-inline-start: calc(var(--space-xxlarge) - var(--space-medium));
      }
    }

    // Arrow is pointed on left side of box
    &.arrow-inline-start {
      &::after {
        content: '';
        position: absolute;
        inset-block-start: 50%;
        inset-inline-end: calc(var(--space-small) * -1);
        transform: translateY(-50%) rotate(225deg);
        height: 16px;
        width: 16px;
        background: var(--newtab-background-color-secondary);
        box-shadow: -4px 4px 6px -2px rgba(0, 0, 0, 15%);
      }
    }

    // Arrow is pointed on left side of box
    &.arrow-inline-end {
      &::after {
        content: '';
        position: absolute;
        inset-block-start: 50%;
        inset-inline-start: calc(var(--space-small) * -1);
        transform: translateY(-50%) rotate(135deg);
        height: 16px;
        width: 16px;
        background: var(--newtab-background-color-secondary);
        box-shadow: 4px 4px 6px -2px rgba(0, 0, 0, 15%);
      }
    }

    // arrow is on the top of the box centered
    &.arrow-top-center {
      &::after {
        inset-block-start: calc(var(--space-small) * -1);
        inset-inline-start: 50%;
        transform: translateX(-50%) rotate(225deg);
        height: 16px;
        width: 16px;
      }
    }

    p {
      font-size: var(--font-size-small);
      font-weight: var(--font-weight);
      margin: var(--space-large) 0;
      flex-grow: 1;
    }
  }

  .toggle-button {
    border: none;
    padding: 0;

    &.isHidden {
      display: none;
    }
  }
}