Jump to content

How to change CSS to affect #colour on one section

Recommended Posts

I've injected this CSS to create animated hover over effect on hyperlinks, but it's applying uniformly across site. This means the hover effect is #000000 even if on a dark background, making it illegible.  Is there a way to create an override for darker pages, to that it shows as #FFFFFF?

 

// Fade Out Line Hyperlink - Middle Stretch Out //
p a{
  display: inline-block;
  style: none !important; 
}

p a:hover:after{
  transform: scaleX(1) !important;
}

p a:after {
  display:block;
  content: '';
  border-bottom: solid 2px #000000 !important; 

p a:after {
  transform: scaleX(0);  
  transition: transform 250ms ease-in-out;
  z-index: 999 !important;
 }

 

Site link: https://mandarin-circle-ndlm.squarespace.com/home

Password: 20tyde21!

Thanks

M

Screenshot 2021-06-14 at 15.32.52.png

Screenshot 2021-06-14 at 15.32.58.png

Link to comment
  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

You can set color: #ffffff;

then add this CSS to change underline color on Light Theme

section[data-current-styles*="light"] p a::after {
    border-color: white !important;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Thanks for this. That code works/changes on light background. It's the dark background that I need changing though. Do you know how 'Darkest 1' background option is referred to as in CSS? I've tried changing "light" to "darkest" and "darkest 1" but neither are working...?

Link to comment

The dark background has no data current style. 

Try this

section:not([data-current-styles*="light"]) p a::after {
    border-color: green !important;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
On 6/17/2021 at 3:59 PM, MarcUK1603 said:

That's done it worked - brilliant. Thanks for help. Out of curiosity, why hasn't SS applied a current data style? It has for "light" but you're right, having inspected the theme for "dark" there's nothing set/showing? Weird. 

Not sure. Do you want fix these?

Site URL: https://mandarin-circle-ndlm.squarespace.com/home

1. (Tablet-Homepage) resize text?

mandarin-circle-ndlm.squarespace.com-01-

2. (Tablet-Homepage) Make 2 items/row + reduce text size?

mandarin-circle-ndlm.squarespace.com-02-

3. (Mobile-Homepage) Make buttons side by side?

mandarin-circle-ndlm.squarespace.com-03-

4. (Mobile-Header) Click burger, nothing appear

mandarin-circle-ndlm.squarespace.com-04-

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.