Skip to content

Commit

Permalink
fix: cookiebot styling
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCatLady committed Oct 30, 2024
1 parent d402028 commit 6c6498e
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 71 deletions.
8 changes: 4 additions & 4 deletions src/components/common/buttons/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,23 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(
],
variant === 'outline' && [
'text-purple-600',
'border border-purple-600',
'border-purple-600',
'hover:bg-purple-50 active:bg-purple-100 disabled:bg-purple-100',
],
variant === 'ghost' && [
'text-purple-600',
'border border-transparent',
'border-transparent',
'hover:border-purple-600 active:border-purple-700',
],
variant === 'light' && [
'bg-white text-gray-700',
'border border-white',
'border-white',
'hover:border-white/75 hover:bg-white/75 hover:text-gray-800',
'active:border-white/50 active:bg-white/50 disabled:border-gray-200 disabled:bg-gray-200',
],
variant === 'dark' && [
'bg-gray-900 text-white',
'border border-gray-600',
'border-gray-600',
'hover:bg-gray-800 active:bg-gray-700 disabled:bg-gray-700',
],
],
Expand Down
9 changes: 5 additions & 4 deletions src/components/common/links/ButtonLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const ButtonLink = forwardRef<HTMLAnchorElement, ButtonLinkProps>(
className={cn(
'inline-flex items-center whitespace-nowrap font-bold',
'focus:outline-none focus-visible:ring focus-visible:ring-purple-500',
'border',
'disabled:opacity-50',
'transition-colors duration-75',
//#region //*=========== Size ===========
Expand All @@ -59,23 +60,23 @@ const ButtonLink = forwardRef<HTMLAnchorElement, ButtonLinkProps>(
],
variant === 'outline' && [
'text-purple-600',
'border border-purple-600',
'border-purple-600',
'hover:bg-purple-50 active:bg-purple-100 disabled:bg-purple-100',
],
variant === 'ghost' && [
'text-purple-600',
'border border-transparent',
'border-transparent',
'hover:border-purple-600 active:border-purple-700',
],
variant === 'light' && [
'bg-white text-gray-700',
'border border-white',
'border-white',
'hover:border-white/75 hover:bg-white/75 hover:text-gray-800',
'active:border-white/50 active:bg-white/50 disabled:border-gray-200 disabled:bg-gray-200',
],
variant === 'dark' && [
'bg-gray-900 text-white',
'border border-gray-600',
'border-gray-600',
'hover:bg-gray-800 active:bg-gray-700 disabled:bg-gray-700',
],
],
Expand Down
128 changes: 65 additions & 63 deletions src/styles/cookiebot.css
Original file line number Diff line number Diff line change
@@ -1,88 +1,90 @@
/* Branding on the banner */
a#CybotCookiebotDialogPoweredbyCybot,
div#CybotCookiebotDialogPoweredByText {
@apply hidden;
}

/* Branding on the Privacy trigger */
#CookiebotWidget .CookiebotWidget-body .CookiebotWidget-main-logo {
@apply hidden;
}

#CybotCookiebotDialog {
@apply !bottom-0 !top-auto !rounded-none;
border: 7px solid var(--color-primary--light) !important;
transform: translate(-50%, -10px) !important;
@apply rounded-xl p-0 font-sans !important;

* {
@apply text-base !important;
}

.CybotCookiebotDialogContentWrapper {
@apply !max-w-screen-xl !items-center;
@apply max-w-7xl p-6 lg:px-8 !important;

#CybotCookiebotDialogNav {
.CybotCookiebotDialogNavItemLink {
@apply whitespace-nowrap border-x-0 border-b-2 border-t-0 border-transparent px-1 py-4 text-sm font-semibold text-gray-500 hover:border-gray-300 hover:text-gray-700 !important;
}

#CybotCookiebotDialogBodyUnderlay {
* {
@apply !text-sm;
.CybotCookiebotDialogNavItemLink.CybotCookiebotDialogActive {
@apply border-b-2 border-purple-500 text-purple-600 !important;
}
}

#CybotCookiebotDialogBodyContent {
#CybotCookiebotDialogBodyContentTitle,
.CybotCookiebotDialogBodyBottomWrapper {
@apply !hidden;
#CybotCookiebotDialogTabContent {
@apply ml-0 !important;

.CybotCookiebotScrollContainer,
.CybotCookiebotScrollArea {
@apply px-0 !important;

#CybotCookiebotDialogBodyContentText,
#CybotCookiebotDialogDetailBodyContentTextAbout {
@apply text-sm !important;
}
}
}
}
}

#CybotCookiebotDialogFooter {
.CybotCookiebotDialogBodyButton {
@apply !inline-block !w-auto items-center whitespace-nowrap rounded-md border border-purple-700 px-4 py-2 !font-sans text-base font-bold transition-colors duration-75 hover:opacity-100 focus:outline-none focus-visible:ring focus-visible:ring-purple-500 disabled:cursor-not-allowed disabled:bg-purple-600 disabled:opacity-50 !important;
}
.CybotCookiebotDialogDetailBodyContentCookieTypeIntro {
@apply text-sm !important;
}

.CybotCookiebotDialogBodyLevelButtonSlider {
@apply inline-flex h-6 w-11 rounded-full border-2 border-transparent bg-gray-200 transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-purple-600 focus:ring-offset-2 !important;
}

input:checked + .CybotCookiebotDialogBodyLevelButtonSlider {
@apply bg-purple-600 !important;
}

#CybotCookiebotDialogBodyButtonDecline,
#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll {
@apply bg-purple-600 text-white hover:bg-purple-700 hover:text-white active:border-purple-800 active:bg-purple-800 disabled:border-purple-600 !important;
.CybotCookiebotDialogBodyLevelButtonSlider:before {
@apply pointer-events-none bottom-0 left-0 inline-block h-5 w-5 rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out !important;
}

input:checked + .CybotCookiebotDialogBodyLevelButtonSlider:before {
@apply translate-x-5 !important;
}
}

#CybotCookiebotDialogBodyLevelButtonCustomize {
@apply mb-0 border border-transparent text-purple-600 hover:border-purple-600 focus:outline-none focus-visible:ring focus-visible:ring-purple-500 active:border-purple-700 disabled:opacity-50 !important;
#CybotCookiebotDialogFooter {
@apply p-0 !important;
}
}

#CybotCookiebotDialog.CybotEdge #CybotCookiebotDialogFooter {
#CybotCookiebotDialogBodyButtonsWrapper {
@apply !gap-x-2;
@apply space-x-2 space-y-2 !important;

@media screen and (min-width: 600px) {
@apply !flex-row-reverse;
.CybotCookiebotDialogBodyButton {
@apply m-0 min-w-min max-w-36 whitespace-nowrap rounded border border-transparent px-3 py-1.5 text-sm font-bold text-purple-600 transition-colors duration-75 hover:border-purple-600 focus:outline-none focus-visible:ring active:border-purple-700 disabled:opacity-50 !important;
}
}

.CybotCookiebotDialogBodyButton:not(:first-of-type) {
@media screen and (min-width: 600px) {
@apply !mb-0;
#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll {
@apply border-purple-600 bg-purple-600 text-white hover:border-purple-700 hover:bg-purple-700 active:border-purple-800 active:bg-purple-800 disabled:border-purple-600 disabled:bg-purple-600 !important;
}
}
}

CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll {
@apply !border-none;
}

#CybotCookiebotDialog #CybotCookiebotDialogFooter .CybotCookiebotDialogHide,
#CybotCookiebotDialogPoweredByText {
@apply !hidden;
}
.CybotCookiebotDialogBodyButton:hover {
@apply opacity-100 !important;
}
}

#CybotCookiebotDialogNav .CybotCookiebotDialogNavItemLink {
@apply !px-[1em] !pb-[1em] !pt-[1.8em];
}
.CybotCookiebotDialogBodyBottomWrapper {
@apply mt-0 !important;

#CybotCookiebotDialog .CybotCookiebotScrollContainer,
#CybotCookiebotDialog #CybotCookiebotDialogBody .CybotCookiebotScrollContainer,
#CybotCookiebotDialogNav,
#CybotCookiebotDialogHeader {
@apply !border-none;
}
#CybotCookiebotDialogBodyEdgeMoreDetails * {
@apply text-sm !important;
}
}

#CybotCookiebotDialogHeader {
@apply !hidden;
#CybotCookiebotDialogHeader,
.CybotCookiebotDialogArrow,
#CybotCookiebotDialogDetailFooter,
a:after {
@apply hidden !important;
}
}

0 comments on commit 6c6498e

Please sign in to comment.