John Cowen b8166de30d
ui: Replaces almost all remaining instances of SASS variables with CSS (#11200)
From an engineers perspective, whenever specifying colors from now on we should use the form:

```
color: rgb(var(--tone-red-500));
```

Please note:

- Use rgb. This lets us do this like rgb(var(--tone-red-500) / 10%) so we can use a 10% opacity red-500 if we ever need to whilst still making use of our color tokens.
- Use --tone-colorName-000 (so the prefix tone). Previously we could use a mix of --gray-500: $gray-500 (note the left hand CSS prop and right hand SASS var) for the things we need to theme currently. As we no longer use SASS we can't do --gray-500: --gray-500, so we now do --tone-gray-500: --gray-500.

Just for clarity after that, whenever specifying a color anywhere, use rgb and --tone. There is only one reason where you might not use tone, and that is if you never want a color to be affected by a theme (for example a background shadow probably always should use --black)

There are a 2 or 3 left for the code editor, plus our custom-query values
2021-10-07 19:21:11 +01:00

75 lines
1.4 KiB
SCSS

.tippy-box[data-theme~='tooltip'] {
& {
@extend %tooltip-bubble;
}
.tippy-content {
@extend %tooltip-content;
}
.tippy-arrow {
@extend %tooltip-tail;
}
&[data-placement^='bottom'] > .tippy-arrow {
@extend %tooltip-tail-bottom;
}
&[data-placement^='top'] > .tippy-arrow {
@extend %tooltip-tail-top;
}
&[data-placement^='left'] > .tippy-arrow {
@extend %tooltip-tail-left;
}
&[data-placement^='right'] > .tippy-arrow {
@extend %tooltip-tail-right;
}
}
%tooltip-content {
@extend %p3;
padding: 12px;
max-width: 224px;
position: relative;
z-index: 1;
}
%tooltip-bubble {
& {
background-color: rgb(var(--tone-gray-700));
color: rgb(var(--white));
}
}
%tooltip-tail {
--size: 5px;
& {
color: rgb(var(--tone-gray-700));
width: calc(var(--size) * 2);
height: calc(var(--size) * 2);
}
&::before {
border-color: var(--transparent);
border-style: solid;
}
}
%tooltip-tail-top {
&::before {
border-width: var(--size) var(--size) 0;
border-top-color: initial;
}
}
%tooltip-tail-bottom {
&::before {
border-width: 0 var(--size) var(--size);
border-bottom-color: initial;
}
}
%tooltip-tail-left {
&::before {
border-width: var(--size) 0 var(--size) var(--size);
border-left-color: initial;
}
}
%tooltip-tail-right {
&::before {
border-width: var(--size) var(--size) var(--size) 0;
border-right-color: initial;
}
}