Skip to content

Commit

Permalink
Update settings and other dialogs to use CSS variables for colors (#3024
Browse files Browse the repository at this point in the history
)

This is a continuation of moving to CSS variables for colors within the app.
This is a large one that updates most of the Settings and other dialogs.
  • Loading branch information
sandymcfadden authored Sep 28, 2021
1 parent 1aa6662 commit cdfd445
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 37 deletions.
2 changes: 1 addition & 1 deletion lib/components/panel-title/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const PanelTitle: FunctionComponent<OwnProps> = ({
}) => {
return createElement(
`h${headingLevel}`,
{ className: 'panel-title theme-color-fg-dim' },
{ className: 'panel-title' },
children
);
};
Expand Down
1 change: 1 addition & 0 deletions lib/components/panel-title/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.panel-title {
color: var(--foreground-color);
margin: 0 0 0.5em;
text-transform: uppercase;
font-size: 90%;
Expand Down
2 changes: 1 addition & 1 deletion lib/components/tab-panels/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class TabPanels extends Component<OwnProps> {

return (
<Tabs selectedTabClassName="is-active">
<TabList className="tab-panels__tab-list theme-color-border">
<TabList className="tab-panels__tab-list">
{tabNames.map((tabName, key) => (
<Tab className="button button-borderless" key={key}>
{tabName}
Expand Down
25 changes: 8 additions & 17 deletions lib/components/tab-panels/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,32 @@
justify-content: center;
margin: 0;
padding: 0;
border-bottom: 1px solid;
border-bottom: 1px solid var(--secondary-color);
list-style: none;

li {
margin: 0 0.5em;
border-bottom: 2px solid;
padding: 0.75em;
color: var(--primary-color);
color: var(--accent-color);
text-transform: capitalize;
border-radius: 0;

&.button {
border-bottom-color: transparent;
}
border-bottom-color: var(--secondary-color);

&.is-active {
color: var(--accent-color);
border-bottom-color: var(--accent-color);
&.is-active {
color: var(--accent-color);
border-bottom-color: var(--accent-color);
}
}

&:active {
color: var(--background-color);
}
}
}

body[data-theme='light'] .tab-panels__tab-list li.is-active {
color: var(--accent-color);
border-bottom-color: var(--accent-color);
}

body[data-theme='dark'] .tab-panels__tab-list li.is-active {
color: var(--accent-color);
border-bottom-color: var(--accent-color);
}

.tab-panels__panel {
height: 30.5em;
overflow: auto;
Expand Down
9 changes: 2 additions & 7 deletions lib/dialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,9 @@ export class Dialog extends Component {
} = this.props;

return (
<div
className={classNames(
className,
'dialog theme-color-bg theme-color-fg theme-color-border'
)}
>
<div className={classNames(className, 'dialog')}>
{!hideTitleBar && (
<div className="dialog-title-bar theme-color-border">
<div className="dialog-title-bar">
<h2 className="dialog-title-text">{title}</h2>
<div className="dialog-title-side">
{!!onDone && (
Expand Down
1 change: 1 addition & 0 deletions lib/dialog/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ $dialog-title-height: 56px;
}

.dialog-title-text {
color: var(--primary-color);
flex: 1 1 auto;
margin: 15px 0 0 16px;
text-align: left;
Expand Down
2 changes: 1 addition & 1 deletion lib/dialogs/button-group/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const ButtonGroup = (props) => {
return (
<ul className="button-group">
{items.map((item) => (
<li key={item.slug} className="button-group__item theme-color-border">
<li key={item.slug} className="button-group__item">
<button type="button" onClick={() => onClickItem(item)}>
{item.name}
<SmallChevronRightIcon />
Expand Down
4 changes: 2 additions & 2 deletions lib/dialogs/button-group/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
}

.button-group__item {
color: var(--primary-color);
display: flex;
height: 3em;
margin: 0;
border-width: 1px;
border-style: solid;
border: 1px solid var(--secondary-color);

& + & {
border-top-width: 0;
Expand Down
1 change: 1 addition & 0 deletions lib/dialogs/keybindings/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
}

.dialog-content {
color: var(--primary-color);
padding: 10px 20px 20px;
max-height: calc(100vh - 2rem - 56px);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/dialogs/settings-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export const SettingsGroup = ({
return (
<div className="settings-group">
<PanelTitle headingLevel={3}>{groupTitle}</PanelTitle>
<div className="settings-items theme-color-border">
<div className="settings-items">
{childElements.map(({ props: { slug, title } }) => (
<label
className="settings-item theme-color-border"
className="settings-item"
htmlFor={`settings-field-${groupSlug}-${slug}`}
key={slug}
>
Expand Down
4 changes: 2 additions & 2 deletions lib/dialogs/settings/panels/account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ const AccountPanel: FunctionComponent<Props> = ({
<div className="settings-account">
<PanelTitle headingLevel={3}>Account</PanelTitle>

<div className="settings-items theme-color-border">
<div className="settings-item theme-color-border">
<div className="settings-items">
<div className="settings-item">
<span className="settings-account-name">{accountName}</span>
</div>
</div>
Expand Down
7 changes: 6 additions & 1 deletion lib/dialogs/settings/style.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.settings {
max-width: 630px;

.button-borderless {
color: var(--accent-color);
}

&.dialog {
max-height: calc(100vh - 2rem);

Expand Down Expand Up @@ -33,12 +37,13 @@

p {
line-height: normal;
color: var(--primary-color);
color: var(--settings-fg-color);
}
}

.settings-items {
border: 1px solid var(--secondary-color);
color: var(--primary-color);
}

.settings-item {
Expand Down
6 changes: 3 additions & 3 deletions lib/dialogs/share/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ export class ShareDialog extends Component<Props> {
Add an email address of another Simplenote user to share a note.
You&apos;ll both be able to edit and view the note.
</p>
<div className="settings-items theme-color-border">
<div className="settings-items">
<form
className="settings-item theme-color-border"
className="settings-item"
onSubmit={this.onAddCollaborator}
>
<input
Expand All @@ -101,7 +101,7 @@ export class ShareDialog extends Component<Props> {
</div>
</div>
<div className="settings-group">
<div className="share-collaborators-heading theme-color-border">
<div className="share-collaborators-heading">
<PanelTitle headingLevel={3}>Collaborators</PanelTitle>
</div>
<ul className="share-collaborators">
Expand Down
1 change: 1 addition & 0 deletions lib/dialogs/share/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
}

.share-collaborator-name {
color: var(--primary-color);
flex: 1 1 auto;
font-size: 143%;
font-weight: $light;
Expand Down
1 change: 1 addition & 0 deletions lib/dialogs/trash-tag-confirmation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
}

.dialog-content {
color: var(--primary-color);
padding: 0 16px;

.dialog-inner-content {
Expand Down
2 changes: 2 additions & 0 deletions lib/dialogs/unsynchronized/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

.explanation,
.explanation-secondary {
color: var(--primary-color);
font-size: 14px;
margin: 12px 0;
padding-left: 16px;
Expand Down Expand Up @@ -47,6 +48,7 @@
}

li span {
color: var(--primary-color);
padding-left: 5px;
padding-right: 16px;
overflow: hidden;
Expand Down

0 comments on commit cdfd445

Please sign in to comment.