Skip to content

Commit

Permalink
feat(ld-cookie-consent): rename "reject all" label
Browse files Browse the repository at this point in the history
  • Loading branch information
renet committed May 2, 2023
1 parent c551e4c commit 5edb487
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
font-family: var(--ld-font-body);

ld-accordion-toggle::part(toggle),
ld-btn::part(button),
ld-button::part(button),
ld-typo::part(tag) {
font-family: inherit;
}
Expand Down Expand Up @@ -190,24 +190,30 @@
}
}

.ld-cookie-consent__disclaimer-btn-accept-all {
.ld-cookie-consent__disclaimer--rejectable & {
grid-column: span 2;
.ld-cookie-consent__btn {
flex-grow: 1;

&::part(button) {
white-space: nowrap;
}

&--accept-all {
flex-grow: 10;
}
}

.ld-cookie-consent__disclaimer-btn-acknowledge {
justify-self: flex-end;
min-width: min(10rem, 50%);
&--acknowledge {
justify-self: flex-end;
min-width: min(10rem, 50%);
}
}

.ld-cookie-consent__disclaimer-buttons {
background-color: var(--ld-col-neutral-010);
border-bottom-left-radius: var(--ld-br-l);
border-bottom-right-radius: var(--ld-br-l);
display: grid;
display: flex;
flex-wrap: wrap;
gap: var(--ld-sp-12);
grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
padding: var(--ld-sp-16);
}

Expand Down Expand Up @@ -293,10 +299,6 @@
}
}

.ld-cookie-consent__preferences-btn-accept-all {
grid-column: span 2;
}

.ld-cookie-consent__preferences-category-description {
padding: var(--ld-sp-12) var(--ld-accordion-padding-x);
}
Expand Down Expand Up @@ -349,9 +351,10 @@
}

.ld-cookie-consent__preferences-buttons {
display: grid;
display: flex;
flex-wrap: wrap;
justify-content: stretch;
gap: var(--ld-sp-12);
grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
}

.ld-cookie-consent__disclaimer-logo-container,
Expand Down
17 changes: 9 additions & 8 deletions src/liquid/components/ld-cookie-consent/ld-cookie-consent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class LdCookieConsent {
backdropBlur: true,
buttonAcceptAll: 'Accept all',
buttonAcceptCookies: 'Accept cookies',
buttonAcceptNone: 'Reject all',
buttonAcceptNone: 'Accept only necessary',
buttonAcceptSelected: 'Accept selected',
buttonAcknowledge: 'Acknowledge',
buttonDismiss: 'Dismiss',
Expand Down Expand Up @@ -468,7 +468,7 @@ export class LdCookieConsent {
>
{config.mode !== 'notice-only' && (
<ld-button
class="ld-cookie-consent__disclaimer-btn-preferences"
class="ld-cookie-consent__btn ld-cookie-consent__btn--preferences"
mode="secondary"
onClick={() => {
this.showPreferences()
Expand All @@ -481,7 +481,7 @@ export class LdCookieConsent {
)}
{config.mode !== 'notice-only' && config.rejectable && (
<ld-button
class="ld-cookie-consent__disclaimer-btn-accept-none"
class="ld-cookie-consent__btn ld-cookie-consent__btn--accept-none"
mode="secondary"
onClick={() => {
this.hideDisclaimerAndPreferences()
Expand All @@ -495,9 +495,10 @@ export class LdCookieConsent {
)}
<ld-button
class={getClassNames([
'ld-cookie-consent__btn',
config.mode === 'notice-only'
? 'ld-cookie-consent__disclaimer-btn-acknowledge'
: 'ld-cookie-consent__disclaimer-btn-accept-all',
? 'ld-cookie-consent__btn--acknowledge'
: 'ld-cookie-consent__btn--accept-all',
])}
onClick={() => {
this.hideDisclaimerAndPreferences()
Expand Down Expand Up @@ -572,7 +573,7 @@ export class LdCookieConsent {
>
{config.buttonAcceptNone && (
<ld-button
class="ld-cookie-consent__btn--accept-none"
class="ld-cookie-consent__btn ld-cookie-consent__btn--accept-none"
mode="secondary"
onClick={() => {
this.hideDisclaimerAndPreferences()
Expand All @@ -586,7 +587,7 @@ export class LdCookieConsent {
)}
{config.buttonAcceptSelected && (
<ld-button
class="ld-cookie-consent__btn--accept-selected"
class="ld-cookie-consent__btn ld-cookie-consent__btn--accept-selected"
mode="secondary"
onClick={() => {
this.hideDisclaimerAndPreferences()
Expand All @@ -600,7 +601,7 @@ export class LdCookieConsent {
)}
{config.buttonAcceptAll && (
<ld-button
class="ld-cookie-consent__preferences-btn-accept-all"
class="ld-cookie-consent__btn ld-cookie-consent__btn--accept-all"
onClick={() => {
this.hideDisclaimerAndPreferences()
this.saveConsent('accept-all')
Expand Down

0 comments on commit 5edb487

Please sign in to comment.