SureCookie Re-Consent Button Styling with Kadence
Making use of the SureCookie plugin, I wanted to make use of the shortcode for re-consent as well as the floating widget. Rather than keep to the default provided text, why not style it as a button in the same style as the rest of the website.
This code can be placed inside the custom CSS section of the SureCookie plugin. It could be placed elsewhere, but as it’s only needed when the plugin is in use, it makes sense to place it here so that should it be decided to change plugin, there’s no redundant code to take care of.
The same code has been used on multiple websites that use Kadence blocks and it automatically picks up the relevant colours in use for the respective websites.
.surecookie-reconsent-btn {
display: inline-flex !important;
width: fit-content !important; /* Prevents the button from stretching full width */
align-items: center !important;
justify-content: center !important;
padding: 0.6em 1.25em !important;
font-size: 1rem;
font-weight: 600;
text-decoration: none !important;
cursor: pointer;
border: none;
border-radius: 4px;
/* Inherit Kadence Global Colors */
background-color: var(--global-palette1, #2B6CB0) !important;
color: #ffffff !important;
transition: all 0.2s ease-in-out;
}
/* Hover State */
.surecookie-reconsent-btn:hover,
.surecookie-reconsent-btn:focus {
background-color: var(--global-palette2, #2C5282) !important;
color: #ffffff !important;
}