notion-enhancer/mods/collapsible-headers/app.css
2020-12-06 05:13:01 +11:00

87 lines
1.7 KiB
CSS

/*
* collapsible headers
* (c) 2020 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (c) 2020 CloudHill
* under the MIT license
*/
.notion-page-content .notion-selectable[collapsed] {
max-height: 0px;
overflow: hidden;
opacity: 0;
}
.notion-page-content .notion-selectable[collapsed] .notion-selectable {
pointer-events: none;
}
.collapse-header {
flex-grow: 0;
flex-shrink: 0;
align-self: center;
width: 24px;
height: 24px;
padding: 6px;
margin: 0 6px;
border-radius: 3px;
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
cursor: pointer;
transition: 200ms ease-in;
}
.collapse-header:hover {
background: var(--theme--interactive_hover);
}
/* position: left */
.collapse-header:first-child {
margin-left: 2px;
}
/* position: right / inline */
.collapse-header:last-child {
opacity: 0;
}
/* show toggle on: collapsed, hover, focus */
[data-collapsed="true"] .collapse-header:last-child,
[data-collapsed]:hover .collapse-header:last-child,
[data-collapsed] :focus + .collapse-header:last-child {
opacity: 1;
}
.collapse-header svg {
width: 100%;
height: 100%;
transition: transform 200ms ease-out 0s;
}
/* position: left */
.collapse-header:first-child svg {
transform: rotateZ(90deg);
}
/* position: right / inline */
.collapse-header:last-child svg {
transform: rotateZ(270deg);
}
[data-collapsed="false"] .collapse-header svg {
transform: rotateZ(180deg);
}
/* position: inline */
[inline-toggle] {
position: relative;
overflow: hidden;
}
[inline-toggle] [placeholder] {
width: auto !important;
}
[inline-toggle] [placeholder]::after {
content: '';
position: absolute;
top: 0;
width: 100%;
height: 100%;
cursor: text;
}