Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix palette variance between colors and fonts in drawer, consolidate styles into a shared selector #166

Merged
merged 2 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ const DesignColors = () => {
paletteRenderedList.push(
<div
key={ colorStyle }
className={ `color-palette ${
className={ `color-palette drawer-palette--button ${
colorStyle == selectedColors?.slug
? 'color-palette-selected'
? 'color-palette-selected drawer-palette--button--selected'
: ''
} ` }
onClick={ ( e ) => handleClick( colorStyle ) }
Expand All @@ -304,7 +304,7 @@ const DesignColors = () => {
} }
/>
</div>
<div className="color-palette__name">
<div className="color-palette__name drawer-palette--button__text">
{ colorStyle?.charAt( 0 ).toUpperCase() +
colorStyle?.slice( 1 ) }
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,15 @@ const DesignTypography = () => {
if ( splitLabel.length == 0 ) continue;
paletteRenderedList.push(
<div
className={ `font-palette ${
selectedFont == fontStyle ? 'font-palette-selected' : ''
className={ `font-palette drawer-palette--button ${
selectedFont == fontStyle
? 'font-palette-selected drawer-palette--button--selected'
: ''
} ` }
onClick={ ( e ) => handleClick( fontStyle ) }
>
<div
className="font-palette__icon"
className="font-palette__icon drawer-palette--button__text"
style={ {
fontFamily:
fontPalettes[ fontStyle ]?.styles?.typography
Expand All @@ -149,7 +151,7 @@ const DesignTypography = () => {
>
Aa
</div>
<div className="font-palette__name">
<div className="font-palette__name drawer-palette--button__text">
<span
style={ {
fontFamily:
Expand Down
83 changes: 32 additions & 51 deletions src/OnboardingSPA/components/Drawer/stylesheet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -361,29 +361,8 @@ $main-border-main--rgb: var(--nfd-onboarding-highlighted--rgb);
}

.color-palette {

width: 88%;
height: 30px;
display: flex;
margin: 8px 4px;
cursor: pointer;
position: relative;
padding: 10px 16px;
align-items: center;
background-color: white;
justify-content: space-between;

&:hover {
background-color: var(--nfd-onboarding-drawer-icon-fill);
}

&-selected {
background-color: $main-border-main;
.color-palette__name {
color: var(--nfd-onboarding-light);
}
}

&__colors {

display: flex;
Expand Down Expand Up @@ -416,12 +395,39 @@ $main-border-main--rgb: var(--nfd-onboarding-highlighted--rgb);
border: 1px solid rgba(0, 0, 0, 0.3);
}
}
}

&__name {
color: black;
font-size: 12px;
font-weight: 700;
line-height: 16px;
.drawer-palette {

&--button {
width: 88%;
height: 30px;
display: flex;
margin: 8px 4px;
cursor: pointer;
position: relative;
padding: 10px 16px;
align-items: center;
background-color: var(--nfd-onboarding-white);

&:hover {
background-color: var(--nfd-onboarding-tertiary);
}

&--selected {
background-color: var(--nfd-onboarding-primary-alt);

.drawer-palette--button__text {
color: var(--nfd-onboarding-white);
}
}

&__text {
color: black;
font-size: 12px;
font-weight: 700;
line-height: 16px;
}
}
}

Expand Down Expand Up @@ -521,36 +527,11 @@ $main-border-main--rgb: var(--nfd-onboarding-highlighted--rgb);

.font-palette {

width: 88%;
height: 30px;
display: flex;
margin: 8px 4px;
cursor: pointer;
position: relative;
padding: 10px 16px;
align-items: center;
background-color: white;

&:hover {
background-color: var(--nfd-onboarding-drawer-icon-fill);
}

&-selected {
background-color: $main-border-main;
}

&__icon {
color: black;
font-weight: 700;
margin-right: 16px;
}

&__name {
color: black;
font-size: 12px;
font-weight: 700;
line-height: 16px;
}
}

.custom-font-palette {
Expand Down