Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bjornlll/432b17a429818a0402c3b7bf3a38aa8e to your computer and use it in GitHub Desktop.
Save bjornlll/432b17a429818a0402c3b7bf3a38aa8e to your computer and use it in GitHub Desktop.
SquareSpace: Target individual pages with CSS
/**
* This code has to be inserted in the "Custom CSS" menu, under "Design".
* Put any and all styling here, for all your tags (and pages)
*/
html[data-tags*=blog] #mainNavigation {
/* Restyle the main navigation of all pages tagged with 'blog' */
}
html[data-tags*=lang-en-us] #mainNavigation {
/* Restyle the main navigation of all pages tagged with 'lang-en-us' */
}
<script>
// Tag this page 'lang-en-us' and 'blog'
// This code has to be injected on every page that needs to be tagged, switching out the tags to fit your needs
document.getElementsByTagName('html')[0].setAttribute('data-tags', 'lang-en-us blog');
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment