mediawiki-skins-Citizen/resources/skins.citizen.preferences/skins.citizen.preferences.less
alistair3149 1186bdf102
feat(core): update preferences menu behavior
* Adjust font size slider range, it starts at 80% and ends at 180%
* Font size is always shown in percentage now
* Better handling of initial font size, it should now detect browser or site default correctly
* Use relative units
* Tweak styles
2022-05-10 21:45:30 -04:00

185 lines
2.9 KiB
Plaintext

@import '../variables.less';
@import '../mixins.less';
.citizen-pref {
&__button {
box-sizing: content-box;
padding: 0;
border: 0;
appearance: none;
background: transparent;
cursor: pointer;
&[ aria-expanded='true' ] {
background-color: var( --background-color-primary--active );
}
}
&-item {
display: grid;
gap: 0.25rem;
&__label {
display: flex;
width: 100%;
justify-content: space-between;
}
&__title {
color: var( --color-base--subtle );
letter-spacing: 0.75px;
}
&__value {
color: var( --color-base--emphasized );
font-weight: 500;
}
}
&-theme {
&-option {
flex-grow: 1;
padding: 0.5rem 1rem;
border: 2px solid var( --border-color-base );
border-radius: var( --border-radius--medium );
cursor: pointer;
font-weight: 500;
text-align: center;
white-space: nowrap;
&:hover {
border-color: var( --color-primary--hover );
box-shadow: var( --box-shadow-card );
}
&:active {
border-color: var( --color-primary--active );
}
}
}
// We only show min and max value
&__tickmarks {
display: flex;
justify-content: space-between;
color: var( --color-base--subtle );
}
}
#citizen-pref {
&-header {
padding: 1.25rem 1.25rem 0;
h3 {
margin: 0;
font-size: 1rem;
}
}
// TODO: unify the dropdown menu style somewhere
&-panel {
position: absolute;
top: var( --height-header );
right: 1.25rem;
left: 1.25rem;
.citizen-card;
.citizen-card-hide( 100% 0 );
.citizen-card-transition();
&.citizen-pref-panel--active {
.citizen-card-show;
}
fieldset {
padding: 0 1.25rem;
border: 0;
margin: 0;
appearance: none;
font-size: 0.875rem;
}
> * {
opacity: 0;
}
}
&-form {
display: grid;
margin: 1rem 0;
gap: 1.25rem;
}
&-theme {
&-option {
&-light {
background: @color-surface-0;
color: @color-base;
}
&-dark {
background: @color-surface-0-dark;
color: @dark-color-base;
}
}
fieldset {
display: flex;
width: 100%;
padding: 0;
margin-top: 0.25rem;
gap: 0.5rem;
}
// Let label be the radio button
input {
display: none;
&:checked {
+ label {
border-color: var( --color-primary );
}
}
}
}
&-resetbutton {
width: 100%;
padding: 0.625rem 1.25rem;
border: 0;
appearance: none;
background: var( --color-destructive );
border-radius: 0 0 var( --border-radius--medium ) var( --border-radius--medium );
color: #fff;
cursor: pointer;
font-family: inherit;
font-size: 0.875rem;
font-weight: 500;
&:hover {
background: var( --color-destructive--hover );
}
&:active {
background: var( --color-destructive--active );
}
}
}
@media ( min-width: @width-breakpoint-tablet ) {
#citizen-pref {
position: relative;
&-panel {
right: 0;
left: unset;
min-width: 20rem;
}
}
}
@media ( hover: hover ) {
.citizen-pref:hover .citizen-pref__button:after {
transform: rotate3d( 0, 0, 1, 90deg );
}
}