Styles for new Settings Page

This commit is contained in:
infinite-persistence 2021-08-05 16:42:37 +08:00
parent 7da1d8cdf7
commit 3b080012ac
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
3 changed files with 127 additions and 1 deletions

View file

@ -0,0 +1,2 @@
import SettingsRow from './view';
export default SettingsRow;

View file

@ -0,0 +1,36 @@
// @flow
import React from 'react';
import classnames from 'classnames';
type Props = {
title: string,
subtitle?: string,
multirow?: boolean, // Displays the Value widget(s) below the Label instead of on the right.
useVerticalSeparator?: boolean, // Show a separator line between Label and Value. Useful when there are multiple Values.
children?: React$Node,
};
export default function SettingsRow(props: Props) {
const { title, subtitle, multirow, useVerticalSeparator, children } = props;
return (
<div
className={classnames('card__main-actions settings__row', {
'section__actions--between': !multirow,
})}
>
<div className="settings__row--title">
<p>{title}</p>
{subtitle && <p className="settings__row--subtitle">{subtitle}</p>}
</div>
<div
className={classnames('settings__row--value', {
'settings__row--value--multirow': multirow,
'settings__row--value--vertical-separator': useVerticalSeparator,
})}
>
{children && children}
</div>
</div>
);
}

View file

@ -140,7 +140,7 @@
margin-right: var(--spacing-s);
}
@media (max-width: $breakpoint-small) {
@media (max-width: $breakpoint-medium) {
flex-wrap: wrap;
> * {
@ -203,3 +203,91 @@
margin-right: 10px;
}
}
.settings__row {
&:first-child,
&:only-child {
border-top: none;
}
}
.settings__row--title {
min-width: 100%;
align-self: flex-start;
@media (min-width: $breakpoint-small) {
min-width: 60%;
max-width: 60%;
}
}
.settings__row--subtitle {
@extend .section__subtitle;
font-size: var(--font-small);
margin-top: calc(var(--spacing-xxs) / 2);
}
.settings__row--value {
width: 100%;
fieldset-section:not(:only-child) {
margin-top: var(--spacing-s);
}
fieldset-section.radio {
margin-top: var(--spacing-s);
}
fieldset-group {
margin-top: var(--spacing-m);
}
.tags--remove {
margin-bottom: 0;
}
.tags__input-wrapper {
.tag__input {
height: unset;
max-width: unset;
}
}
.form-field--price-amount {
max-width: unset;
}
@media (min-width: $breakpoint-medium) {
width: 40%;
margin-left: var(--spacing-m);
padding-left: var(--spacing-m);
.button,
.checkbox {
&:only-child {
float: right;
}
}
input {
align-self: flex-end;
}
}
}
.settings__row--value--multirow {
@media (min-width: $breakpoint-medium) {
width: 80%;
margin-top: var(--spacing-l);
input {
align-self: flex-start;
}
}
}
.settings__row--value--vertical-separator {
@media (min-width: $breakpoint-medium) {
border-left: 1px solid var(--color-border);
}
}