mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-05 13:19:03 +00:00
* notion-enhancer#261 modify toggle styles to look similiar to notion's toggle * remove `dot` spans from toggles
654 lines
13 KiB
CSS
654 lines
13 KiB
CSS
/*
|
||
* notion-enhancer
|
||
* (c) 2020 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
|
||
* under the MIT license
|
||
*/
|
||
|
||
@import './css/buttons.css';
|
||
@import './css/scrollbars.css';
|
||
|
||
@keyframes spin {
|
||
from {
|
||
transform: rotate(0deg);
|
||
}
|
||
to {
|
||
transform: rotate(360deg);
|
||
}
|
||
}
|
||
|
||
@keyframes fade {
|
||
from {
|
||
opacity: 0;
|
||
}
|
||
to {
|
||
opacity: 1;
|
||
}
|
||
}
|
||
|
||
* {
|
||
box-sizing: border-box;
|
||
word-break: break-word;
|
||
text-decoration: none;
|
||
text-size-adjust: 100%;
|
||
font-family: var(--theme--font_sans);
|
||
outline-color: var(--theme--table-border);
|
||
}
|
||
html,
|
||
body {
|
||
width: 100%;
|
||
height: 100%;
|
||
margin: 0;
|
||
padding: 0;
|
||
display: block;
|
||
overflow: hidden;
|
||
background: var(--theme--main);
|
||
color: var(--theme--text);
|
||
}
|
||
|
||
main {
|
||
padding: 1em 1em 2.9em 1em;
|
||
height: 100%;
|
||
overflow: auto;
|
||
}
|
||
main section {
|
||
border-radius: 2px;
|
||
margin-bottom: 0.75em;
|
||
}
|
||
|
||
/* inline formatting */
|
||
|
||
code {
|
||
border-radius: 0.1em;
|
||
padding: 0.2em 0.4em;
|
||
font: 0.85em var(--theme--font_code);
|
||
background: var(--theme--code_inline-background);
|
||
}
|
||
|
||
button {
|
||
color: var(--theme--text);
|
||
}
|
||
|
||
u {
|
||
text-decoration: underline;
|
||
}
|
||
s {
|
||
text-decoration: line-through;
|
||
}
|
||
|
||
/* titlebar */
|
||
|
||
#titlebar::before {
|
||
content: '';
|
||
position: absolute;
|
||
width: 100%;
|
||
-webkit-app-region: no-drag;
|
||
top: 0;
|
||
left: 0;
|
||
height: 2px;
|
||
}
|
||
|
||
#titlebar {
|
||
display: flex;
|
||
-webkit-app-region: drag;
|
||
background: var(--theme--dragarea);
|
||
}
|
||
#titlebar button {
|
||
-webkit-app-region: no-drag;
|
||
}
|
||
#titlebar .window-buttons-area {
|
||
margin: 0.4em 0.4em 0.4em auto;
|
||
}
|
||
#titlebar .window-buttons-area:empty {
|
||
display: none;
|
||
}
|
||
[data-platform='darwin'] #titlebar {
|
||
height: 2.65em;
|
||
}
|
||
|
||
/* alerts */
|
||
|
||
#alerts [role='alert'] {
|
||
display: flex;
|
||
padding: 0.75em;
|
||
background: var(--theme--interactive_hover);
|
||
border: 1px solid var(--theme--interactive_hover-border);
|
||
}
|
||
#alerts [role='alert']::before {
|
||
content: '!';
|
||
display: block;
|
||
/* margin: auto 0; */
|
||
font-weight: bold;
|
||
font-size: 1.2em;
|
||
padding-right: 0.5rem;
|
||
color: var(--theme--interactive_hover-border);
|
||
}
|
||
#alerts [role='alert'] p {
|
||
font-size: 1rem;
|
||
margin: auto 0;
|
||
padding-left: 0.5em;
|
||
color: var(--theme--line_text);
|
||
}
|
||
|
||
#alerts .error::before {
|
||
color: var(--theme--select_red);
|
||
}
|
||
#alerts .error {
|
||
color: var(--theme--line_red-text);
|
||
background: var(--theme--line_red);
|
||
border-color: var(--theme--select_red);
|
||
}
|
||
#alerts .warning::before {
|
||
color: var(--theme--select_yellow);
|
||
}
|
||
#alerts .warning {
|
||
color: var(--theme--line_yellow-text);
|
||
background: var(--theme--line_yellow);
|
||
border-color: var(--theme--select_yellow);
|
||
}
|
||
#alerts .info::before {
|
||
color: var(--theme--select_blue);
|
||
}
|
||
#alerts .info {
|
||
color: var(--theme--line_blue-text);
|
||
background: var(--theme--line_blue);
|
||
border-color: var(--theme--select_blue);
|
||
}
|
||
#alerts .success::before {
|
||
content: '✓';
|
||
color: var(--theme--select_green);
|
||
}
|
||
#alerts .success {
|
||
color: var(--theme--line_green-text);
|
||
background: var(--theme--line_green);
|
||
border-color: var(--theme--select_green);
|
||
}
|
||
|
||
#alerts code {
|
||
background: transparent;
|
||
text-decoration: underline;
|
||
}
|
||
|
||
[data-action] {
|
||
text-decoration: underline dotted;
|
||
cursor: pointer;
|
||
}
|
||
|
||
/* search */
|
||
|
||
#search {
|
||
position: relative;
|
||
margin-bottom: 0.75em;
|
||
}
|
||
|
||
#search > svg {
|
||
position: absolute;
|
||
width: 1em;
|
||
height: 1em;
|
||
top: 1.3em;
|
||
left: 1em;
|
||
}
|
||
#search > svg path {
|
||
fill: var(--theme--text_ui_info);
|
||
}
|
||
#search > input {
|
||
width: 100%;
|
||
padding: 1em 1.4em 1em 2.8em;
|
||
font: 1em var(--theme--font_sans);
|
||
background: var(--theme--card);
|
||
border: 1px solid var(--theme--table-border);
|
||
color: var(--theme--text);
|
||
border-radius: 2px;
|
||
}
|
||
#search > input::placeholder {
|
||
font-weight: bold;
|
||
color: var(--theme--text_ui_info);
|
||
}
|
||
#search > input:focus {
|
||
box-shadow: var(--theme--table-border) 0.04em 0.04em,
|
||
var(--theme--table-border) -0.04em -0.04em,
|
||
var(--theme--table-border) -0.04em 0.04em,
|
||
var(--theme--table-border) 0.04em -0.04em;
|
||
outline: none;
|
||
}
|
||
|
||
#search #tags > span {
|
||
cursor: pointer;
|
||
display: inline-block;
|
||
font-size: 0.8em;
|
||
padding: 0.2em 0.5em;
|
||
margin-top: 0.5em;
|
||
background: var(--theme--option-background);
|
||
color: var(--theme--option-color);
|
||
border-radius: 2px;
|
||
transition: color 200ms, background 200ms, opacity 200ms;
|
||
user-select: none;
|
||
}
|
||
#search #tags > span:not(:last-child) {
|
||
margin-right: 0.5em;
|
||
}
|
||
#search #tags > span:hover {
|
||
background: var(--theme--option_hover-background);
|
||
color: var(--theme--option_hover-color);
|
||
}
|
||
#search #tags > span::before {
|
||
content: '× ';
|
||
}
|
||
#search #tags > .selected {
|
||
background: var(--tag_color, var(--theme--option_active-background));
|
||
color: var(--theme--option_active-color);
|
||
}
|
||
#search #tags > .selected::before {
|
||
content: '✓ ';
|
||
}
|
||
|
||
/* module meta */
|
||
|
||
#modules {
|
||
position: relative;
|
||
}
|
||
#modules section {
|
||
background: var(--theme--sidebar);
|
||
border: 1px solid var(--theme--table-border);
|
||
}
|
||
#modules section > div {
|
||
padding: 0.75em;
|
||
}
|
||
.notion-light-theme #modules section {
|
||
background: var(--theme--main);
|
||
}
|
||
|
||
#modules section h3,
|
||
#modules section p {
|
||
margin: 0;
|
||
font-size: 1rem;
|
||
}
|
||
|
||
#modules section .desc {
|
||
margin: 0.3em 0 0.4em 0;
|
||
font-size: 0.9em;
|
||
}
|
||
#modules section .desc p {
|
||
font-size: inherit;
|
||
margin: 0;
|
||
}
|
||
#modules section .desc blockquote {
|
||
margin: 0.3em 0;
|
||
border-left: 0.3em solid var(--theme--table-border);
|
||
padding-left: 0.7em;
|
||
}
|
||
|
||
#modules section .desc a {
|
||
color: currentColor;
|
||
text-decoration: underline dotted;
|
||
}
|
||
|
||
#modules section .desc img {
|
||
width: 100%;
|
||
max-width: 20em;
|
||
margin: 0.5em 0;
|
||
}
|
||
#modules section .desc :first-child img:first-child {
|
||
margin-top: 0;
|
||
}
|
||
#modules section .desc :last-child img:last-child {
|
||
margin-bottom: 0;
|
||
}
|
||
|
||
#modules section .author {
|
||
color: currentColor;
|
||
}
|
||
#modules section .author img {
|
||
max-height: 1em;
|
||
max-width: 1em;
|
||
margin-bottom: 0.15625em;
|
||
display: inline-block;
|
||
vertical-align: middle;
|
||
border-radius: 50%;
|
||
}
|
||
#modules section .tags,
|
||
#modules section .version {
|
||
font-size: 0.85em;
|
||
color: var(--theme--text_ui);
|
||
}
|
||
|
||
/* module options */
|
||
|
||
#modules .disabled .options {
|
||
display: none;
|
||
}
|
||
#modules section .options {
|
||
border-top: 1px solid var(--theme--table-border);
|
||
background: var(--theme--card);
|
||
}
|
||
#modules section .options p {
|
||
font-size: 0.9em;
|
||
}
|
||
#modules section .options p:not(:last-child) {
|
||
padding-bottom: 0.5em;
|
||
border-bottom: 0.5px solid var(--theme--table-border);
|
||
margin-bottom: 0.5em;
|
||
}
|
||
|
||
svg[data-tooltip] {
|
||
height: 1em;
|
||
width: 1em;
|
||
margin: 0 0 -2px 1px;
|
||
color: var(--theme--text_ui_info);
|
||
}
|
||
#tooltip {
|
||
pointer-events: none;
|
||
position: absolute;
|
||
padding: 0.25em 0.5em 0.5em 0.5em;
|
||
margin: 0 1em;
|
||
border-radius: 3px;
|
||
box-shadow: var(--theme--box-shadow_strong);
|
||
border-right-width: 1px;
|
||
font-size: calc(var(--theme--font_label-size) * 0.8);
|
||
background: var(--theme--interactive_hover);
|
||
opacity: 0;
|
||
transition: opacity 120ms ease-in;
|
||
}
|
||
#tooltip.active {
|
||
opacity: 1;
|
||
}
|
||
|
||
.toggle *,
|
||
.input *,
|
||
.select *,
|
||
.color *,
|
||
.file * {
|
||
cursor: pointer;
|
||
}
|
||
.select select,
|
||
.input input[type='text'],
|
||
.input input[type='number'],
|
||
.file input[type='file'] + label .choose {
|
||
width: 100%;
|
||
margin: 0.25em 0;
|
||
font-size: 0.9rem;
|
||
padding: 0.4rem 0.2rem;
|
||
border: none;
|
||
color: var(--theme--text);
|
||
background: var(--theme--main);
|
||
}
|
||
.select select:focus,
|
||
.input input[type='text']:focus,
|
||
.input input[type='number']:focus,
|
||
.file input[type='file']:focus + label .choose,
|
||
.file input[type='file'] + label .choose:hover {
|
||
outline: var(--theme--table-border) solid 2px;
|
||
}
|
||
.file input[type='file'],
|
||
.toggle input[type='checkbox'] {
|
||
opacity: 0;
|
||
width: 0.1px;
|
||
height: 0.1px;
|
||
position: fixed;
|
||
}
|
||
|
||
.input input[type='text'],
|
||
.input input[type='number'] {
|
||
padding: 0.4rem;
|
||
cursor: text;
|
||
}
|
||
|
||
.file input[type='file'] + label .label {
|
||
position: relative;
|
||
display: flex;
|
||
}
|
||
.file input[type='file'] + label .label .name {
|
||
flex-basis: calc(100% - 1.5rem);
|
||
}
|
||
.file input[type='file'] + label .label .clear {
|
||
font-size: 1rem;
|
||
position: absolute;
|
||
top: 0.4em;
|
||
right: 0;
|
||
width: 1em;
|
||
height: 0.1em;
|
||
border: 0.35em solid var(--theme--card);
|
||
background: currentColor;
|
||
}
|
||
.file input[type='file'] + label .choose {
|
||
display: block;
|
||
white-space: nowrap;
|
||
overflow: hidden;
|
||
}
|
||
.file input[type='file'] + label .choose svg {
|
||
padding-top: 0.5em;
|
||
height: 1.25em;
|
||
width: 1.25em;
|
||
}
|
||
|
||
.toggle input[type='checkbox'] + label {
|
||
display: flex;
|
||
--menu--toggle_bg: rgba(135, 131, 120, 0.3);
|
||
}
|
||
.toggle input[type='checkbox'] + label .name {
|
||
flex-basis: calc(100% - 2.25em);
|
||
margin-right: 0.75em;
|
||
}
|
||
.toggle input[type='checkbox'] + label .switch {
|
||
position: relative;
|
||
top: 0.2em;
|
||
float: right;
|
||
height: 1em;
|
||
width: 1.85em;
|
||
padding: 0.1em;
|
||
background: var(--menu--toggle_bg);
|
||
border-radius: 3.14em;
|
||
transition: background 300ms;
|
||
}
|
||
.toggle input[type='checkbox'] + label .switch::before {
|
||
content: '';
|
||
display: block;
|
||
width: 0.8em;
|
||
height: 0.8em;
|
||
border-radius: 50%;
|
||
transform: translateX(var(--menu--toggle_offset, 0));
|
||
transition: transform 350ms, box-shadow 350ms;
|
||
background: var(--theme--option_active-color);
|
||
/* box-shadow: 2px 1px 4px var(--theme--table-border); */
|
||
}
|
||
|
||
.toggle input[type='checkbox']:checked + label {
|
||
--menu--toggle_offset: 0.8em;
|
||
--menu--toggle_bg: var(--theme--primary);
|
||
}
|
||
|
||
.color {
|
||
display: flex;
|
||
}
|
||
.color label {
|
||
flex-basis: 70%;
|
||
}
|
||
.color input[type='button'] {
|
||
flex-basis: 30%;
|
||
box-shadow: 2px 1px 4px var(--theme--table-border);
|
||
border: 1px solid var(--theme--option_active-color);
|
||
border-radius: 3px;
|
||
background: var(--configured--color-value);
|
||
margin: 0;
|
||
}
|
||
.color input[type='button']:focus {
|
||
box-shadow: 3px 2px 5px var(--theme--table-border);
|
||
}
|
||
|
||
/* further-configuration popup */
|
||
|
||
#popup,
|
||
#popup-overlay {
|
||
position: absolute;
|
||
top: 0;
|
||
height: 100vh;
|
||
width: 100vw;
|
||
}
|
||
#popup {
|
||
display: none;
|
||
}
|
||
#popup.visible {
|
||
display: flex;
|
||
animation: fade 200ms ease;
|
||
}
|
||
#popup-overlay {
|
||
background: var(--theme--overlay);
|
||
}
|
||
|
||
.colorPicker {
|
||
margin: auto;
|
||
position: relative;
|
||
border: 1px solid var(--theme--table-border);
|
||
background: var(--theme--card);
|
||
}
|
||
|
||
.colorPicker .twod {
|
||
border-radius: 4px;
|
||
}
|
||
.colorPicker .twod .bg {
|
||
border-radius: 2px;
|
||
}
|
||
.colorPicker .oned,
|
||
.colorPicker .oned .bg {
|
||
margin-left: 0;
|
||
height: 212.5px;
|
||
}
|
||
.colorPicker .oned .bg {
|
||
border-radius: 4px;
|
||
border: 1px solid var(--theme--table-border);
|
||
}
|
||
.colorPicker > button {
|
||
display: block;
|
||
position: absolute;
|
||
bottom: 8px;
|
||
right: 8px;
|
||
margin: 0;
|
||
padding: 0;
|
||
border: none;
|
||
width: 21px;
|
||
height: 20px;
|
||
cursor: pointer;
|
||
background: transparent;
|
||
transition: background 0.2s;
|
||
}
|
||
.colorPicker > button::after {
|
||
content: '×';
|
||
font-size: 1.5em;
|
||
position: relative;
|
||
bottom: 5px;
|
||
}
|
||
.colorPicker > button:hover {
|
||
background: var(--theme--interactive_hover);
|
||
border-radius: 4px;
|
||
box-shadow: 0 0 0 0.5px var(--theme--interactive_hover-border);
|
||
}
|
||
.colorPicker > button:focus {
|
||
outline: none;
|
||
box-shadow: 0 0 0 1px var(--theme--table-border);
|
||
}
|
||
.colorPicker .twod .pointer .shape.shape1 {
|
||
width: 11px;
|
||
height: 11px;
|
||
}
|
||
.colorPicker .twod .pointer .shape.shape2 {
|
||
width: 9px;
|
||
height: 9px;
|
||
}
|
||
.colorPicker .oned .pointer .shape {
|
||
height: 6.5px;
|
||
margin-left: 0;
|
||
border: 2px solid #fff;
|
||
box-shadow: 0 0 0 1px #000;
|
||
}
|
||
.shape {
|
||
cursor: pointer;
|
||
}
|
||
|
||
@media (max-width: 300px) {
|
||
.colorPicker .twod,
|
||
.colorPicker .twod .bg {
|
||
width: 200px;
|
||
height: 200px;
|
||
}
|
||
.colorPicker .oned,
|
||
.colorPicker .oned .bg {
|
||
height: 172.5px;
|
||
}
|
||
}
|
||
@media (max-width: 250px) {
|
||
.colorPicker .twod,
|
||
.colorPicker .twod .bg {
|
||
width: 150px;
|
||
height: 150px;
|
||
}
|
||
.colorPicker .oned,
|
||
.colorPicker .oned .bg {
|
||
height: 132.5px;
|
||
}
|
||
}
|
||
|
||
/* draggable re-ordering of mods */
|
||
|
||
#draggable-toggle {
|
||
background: none;
|
||
border: none;
|
||
margin-top: 0.8em;
|
||
padding-left: 0;
|
||
cursor: pointer;
|
||
color: var(--theme--text_ui);
|
||
}
|
||
|
||
[data-bolded] {
|
||
display: inline-flex;
|
||
flex-direction: column;
|
||
}
|
||
[data-bolded]::after {
|
||
content: attr(data-bolded);
|
||
height: 0;
|
||
visibility: hidden;
|
||
overflow: hidden;
|
||
user-select: none;
|
||
pointer-events: none;
|
||
font-weight: bold;
|
||
}
|
||
|
||
.reorder #search #tags > span,
|
||
.reorder #search #tags > span:hover,
|
||
.conflict #search #tags > span,
|
||
.conflict #search #tags > span:hover {
|
||
opacity: 0.7;
|
||
background: var(--theme--option-background);
|
||
}
|
||
.reorder #search #tags > .selected,
|
||
.reorder #search #tags > .selected:hover,
|
||
.conflict #search #tags > .selected,
|
||
.conflict #search #tags > .selected:hover {
|
||
background: var(--tag_color, var(--theme--option_active-background));
|
||
}
|
||
|
||
.reorder #modules .dragged-over::after {
|
||
content: '';
|
||
height: 0.25em;
|
||
width: 99%;
|
||
position: absolute;
|
||
margin: 0.3em 0;
|
||
opacity: 0.7;
|
||
background: var(--theme--selected);
|
||
}
|
||
|
||
.reorder #modules .switch,
|
||
.reorder #modules .tags,
|
||
.reorder #modules .desc,
|
||
.reorder #modules .options,
|
||
.reorder #modules .author,
|
||
.reorder #modules .version {
|
||
display: none;
|
||
}
|
||
.reorder #modules .core .toggle * {
|
||
cursor: text;
|
||
}
|
||
.reorder #modules section:not(.core) label::before {
|
||
content: '::';
|
||
margin-right: 0.4em;
|
||
color: var(--theme--text_ui);
|
||
}
|