mediawiki-skins-Citizen/resources/skins.citizen.styles/components/Sections.less

98 lines
1.8 KiB
Plaintext
Raw Normal View History

// Hide indicator when client is noscript
// FIXME: On rare occasion, indicator can appear without the .citizen-sections-enabled class, not sure why
.citizen-section-indicator,
.client-nojs.citizen-sections-enabled .citizen-section-indicator {
display: none;
}
.citizen-sections-enabled {
.citizen-section {
2021-03-03 01:55:13 +00:00
&-heading {
cursor: pointer;
// So that double clicking won't highlight everything
-webkit-user-select: none;
2021-03-03 01:55:13 +00:00
user-select: none;
2021-03-02 22:16:24 +00:00
2021-03-03 01:55:13 +00:00
&--collapsed {
.citizen-section-indicator {
2021-03-03 01:55:13 +00:00
transform: rotate3d( 1, 0, 0, 180deg );
}
2021-03-02 22:16:24 +00:00
.mw-headline,
.mw-heading h1,
.mw-heading h2 {
2021-03-03 01:55:13 +00:00
opacity: var( --opacity-icon-base );
}
}
2021-03-02 22:16:24 +00:00
.mw-headline,
.mw-heading h1,
.mw-heading h2 {
transition: var( --transition-hover );
transition-property: opacity;
2021-03-03 00:32:55 +00:00
2021-03-03 01:55:13 +00:00
&:hover {
opacity: var( --opacity-icon-base--hover );
}
&:active {
opacity: var( --opacity-icon-base--active );
}
2021-03-03 00:32:55 +00:00
}
}
&-indicator {
display: block;
order: -2;
width: 1rem;
height: 1rem;
margin-right: var( --space-sm );
2021-03-03 01:55:13 +00:00
cursor: pointer;
transition: var( --transition-hover );
transition-property: transform;
2021-03-02 22:16:24 +00:00
}
2021-03-03 01:55:13 +00:00
// Fix button alignment
&-heading,
&-collapsible > h3,
&-collapsible > h4,
&-collapsible > h5,
&-collapsible > h6 {
2021-03-03 01:55:13 +00:00
display: flex;
align-items: center;
// Right-align the editsection
.mw-headline {
flex-grow: 1;
order: -1;
}
2021-03-03 01:55:13 +00:00
}
2021-03-02 22:16:24 +00:00
2021-03-03 01:55:13 +00:00
&-collapsible {
&--collapsed {
display: none;
}
2021-03-02 22:16:24 +00:00
}
}
}
// Fix hover state on touch devices
@media ( hover: none ) {
.citizen-sections-enabled .citizen-section {
&-heading .mw-headline,
&-indicator {
&:hover,
&:active {
opacity: 1;
}
}
&-heading--collapsed .mw-headline {
&:hover,
&:active {
opacity: var( --opacity-icon-base );
}
}
}
}