Lucky Night Studio

View Original

How to Add Custom Effects to Squarespace Navigation with CSS

Hey guys! Today, I've got another tutorial that dives deep into the world of CSS to spice up your Squarespace site's navigation. It's a bit technical but stick with me—these tricks will seriously elevate your website’s style.

What is CSS?

CSS, or Cascading Style Sheets, is the tool that styles the content on your website. Fortunately, Squarespace makes it super easy to tweak and add new CSS through the Custom CSS panel.

Understanding Squarespace’s Class Names

Your Squarespace site is full of class names that link to CSS files, dictating how elements on your site are styled. By manipulating these classes, we can significantly alter the look and feel of the site.

Styling the Navigation

The default navigation in Squarespace typically includes just a basic underline for the selected page. I like to add a hover effect to make it more interactive. Here’s how you can too:

Basic Styling

Navigation items in Squarespace have a class called .header-nav-item. Here’s how you can add some flair:

  1. Hover Effects: To make items stand out on hover, we’ll use the :hover pseudo-class.

  2. Transitions: Adding a transition makes the hover effect smooth and visually appealing.

  3. Borders and Background: Let’s add a border and change the background on hover to make it pop.

Here’s an example of the code you might use:

See this content in the original post

Adding an Animated Line

Now lets look at adding an animated line which will appear from the left. To do this we use the :afrer psuedo which will generate content after our navigation items. Now while this does sound technical, I recommend you copy and paste the code into your site and just give it a try and change some of the colours, timing, positions. You can always delete or undo any changes.

See this content in the original post

Using Animation Libraries

And finally, lets look at the the animation libary: https://animate.style/ here you can see a wide range of animations, and using this link: https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.css you can easily access the css animation, copy and paste it into your website, and you can easily add these animations to your squarespace website, I go into more details in the video

Example: Adding Icons with Rotation Effects

Finally, here’s how you can add icons above your navigation items with a rotation effect on hover. Remember to upload your .png files to the custom files section in the Custom CSS panel:

See this content in the original post

I know this tutorial is a bit more technical than usual, but I encourage you to give it a try—play around, and remember, the undo button is our friend!