Skill level: Mid level +
Tip: Run your SVG code through https://yoksel.github.io/url-encoder/ to make it play nice with CSS.
/* Add SVG Icon To Header */
/* Hide the existing image logo and it's remove height */
.header-title-logo img {
visibility: hidden;
height:0px;
}
.header-title-logo a:after {
@svg: "data:image/svg+xml,
insert your svg code without spaces here
";
content: '';
width: 135px;
height: 135px;
display: inline-block;
vertical-align: bottom; //if position link text beneath, otherwise align middle
background-color: var(--navigationLinkColor); /* grab the dynamic color e.g. the nav link color */
-webkit-mask-image: url(@svg);
-webkit-mask-size: contain;
-webkit-mask-position: center right;
-webkit-mask-repeat: no-repeat;
mask-image: url(@svg);
mask-size: contain;
mask-position: center;
mask-repeat: no-repeat;
}
Skill level: Mid level
If you are new to CSS and SVGs and not sure where to start, this is my workflow for the above example site.
Skill level: Mid level +
A general database in Squarespace is probably in the roadmap somewhere, but in the meantime there's a great (and free) solution using Sheetrock.js which pulls in a Google Sheet to a code block table.
Skill level: Mid level
You can add a second logo with a little JS code and CSS.
<!-- Logo on right of navbar -->
<script> $(document).ready(function() { $('<a class="second-logo" href="#"><img src=""/></a>').appendTo('.header-display-desktop .header-actions.header-actions--right');
});
</script>
<style> a.second-logo img { max-width: 70px;}a.second-logo { margin-left: 2.5vw;}
</style>
/* CSS for Header Second Logo */
.second-logo img { /*visibility: hidden;*/}
.second-logo {
@svg: "data:image/svg+xml, ... [add your own SVG data] ...";
content: '';
width: 80px;
height: 50px;
display: inline-block;
vertical-align: bottom;
background-color: var(--navigationLinkColor);
-webkit-mask-image: url(@svg);
-webkit-mask-size: contain;
-webkit-mask-position: center right;
-webkit-mask-repeat: no-repeat;
mask-image: url(@svg);
mask-size: contain;
mask-position: center;
mask-repeat: no-repeat;
}
/* Logo Header as SVG with currentColor theme */
.header-title-logo img {
visibility: hidden;
height:0px !important;
}
.header-title-logo a:after { @svg: "data:image/svg+xml, ... [add your own SVG data] ...";
content: '';
width: 135px;
height: 135px;
display: inline-block;
vertical-align: bottom;
background-color: var(--navigationLinkColor);
-webkit-mask-image: url(@svg);
-webkit-mask-size: contain;
-webkit-mask-position: center right;
-webkit-mask-repeat: no-repeat;
mask-image: url(@svg);
mask-size: contain;
mask-position: center;
mask-repeat: no-repeat;
}
Skill level: Beginner level
Use a list section to display what appears to be a two column price list, feature list or cafe menu for example.
/* style two column list using SQS lists section */
/* float italic text to right */
.list-item-content__description strong em {
float: right; font-style: normal;}
/* list - override default 75% max-width for mobile */
@media only screen and (max-width: 600px) {
.list-item-content__description {max-width:100% !important;}
}
/* Optional list button */
/* convert underlined link text to button if bold and float right if italics */
.list-item-content__description a strong:has(em) {
float: right; font-style: normal;}
/* style the button */
.list-item-content__description a strong {
padding: 0.25em 0.75em; margin: -0.25em 0 -0.75em;color: var(--primaryButtonTextColor);
background-color: var(--primaryButtonBackgroundColor);
border-color: var(--primaryButtonTextColor);
border-radius: 4px;display: inline-block;
text-decoration: none !important;
text-transform:uppercase;font-size: inherit;}
Skill level: Advanced level
This feature was developed by Recreational to work with the accordion plugin from Will-Myers.com. It can be adapted to work with other lists, not just an accordion.
The actual 'like' button action is inside the accordion item, but the current status of the 'like' is also mirrored in the accordion item title.
<!-- Begin like button and icon code for each lot section --><!-- Like script for accordion list adapted from Jeff Kielman, Codepen -->
<script>
$(".like-false").click( function() {$(this).toggleClass('like-true');
event.preventDefault();});
$(".like-group_btn span").click(function(){
var btnStorage = $(this).attr("id"); if($(this).hasClass("like-true")) {
localStorage.setItem(btnStorage, 'true');
} else {
localStorage.removeItem(btnStorage, 'true');
} });
$( ".like-group_btn span" ).each(function() {
var mainlocalStorage = $( this ).attr( "id" ); if(localStorage.getItem(mainlocalStorage) == 'true') {
$(this).addClass("like-true");
} else {
$(this).removeClass("like-true");
} });
</script><!-- Like button for accordion 'list' -->
<script>
// Button updates the Accordion
// Example button - edit the function name and element ID to match the section:
//function like01() {
// document.getElementById("like-01").classList.toggle('like-true');
//}
// The actual buttons
function like01() {
document.getElementById("like-01").classList.toggle('like-true');
}
function like02() {
document.getElementById("like-02").classList.toggle('like-true');
}
function like03() {
document.getElementById("like-03").classList.toggle('like-true');
}
function like04() {
document.getElementById("like-04").classList.toggle('like-true');
}
function like05() {
document.getElementById("like-05").classList.toggle('like-true');
}
function like06() {
document.getElementById("like-06").classList.toggle('like-true');
}
function like07() {
document.getElementById("like-07").classList.toggle('like-true');
}
function like08() {
document.getElementById("like-08").classList.toggle('like-true');
}
</script>
<!-- Open accordion at specific link ID e.g. https://www.recreational.studio/#like-02-->
<script>
var x = location.hash;
if(document.querySelector(x)){
document.querySelector(x).click();
}
</script>
\e87e
):/* Like icon on accordion title */
.like-false:before, .like-ready:before {
font-family: "Material Icons";
content: "\e87e";
display:inline;
/*font-size:inherit;*/
padding-left:0px;
margin-right:5px;
vertical-align: middle;
color: inherit;
}
.like-true:before {
font-family: "Material Icons";
content: "\e87d";
display:inline;
/*font-size:inherit;*/
padding-left:0px;
margin-right:5px;
vertical-align: middle;
color: var(--primaryButtonBackgroundColor);
}
.like-small {
font-size:24px;
}
.like-large {
font-size:44px;
}
.like-right {
text-align: right;
float:right;
}
.section-name {font-weight:200;text-transform:uppercase}
.section-type {font-weight:200}
.section-type:before {content:"/ ";font-weight:200;color: var(--primaryButtonBackgroundColor);}@media screen and (max-width: 600px) {
.section-type,.section-name {display:block;padding-left: 30px}
.section-type:before {content:""}
}
/* ---- END ---- */
<div data-wm-plugin="accordion">
<button><p><span class="like-group_btn"><span id="like-01" class="like-ready like-small"></span><span class="section-title">Section 01</span></span> <span class="section-name">Blueberry</span> <span class="section-type">Pie<span></p></button>
<button><p><span class="like-group_btn"><span id="like-02" class="like-ready like-small"></span><span class="section-title">Section 02</span></span> <span class="section-name">Chocolate</span> <span class="section-type">Ice Cream<span></p></button>
<button><p><span class="like-group_btn"><span id="like-03" class="like-ready like-small"></span><span class="section-title">Section 03</span></span> <span class="section-name">Apple</span> <span class="section-type">Struddle<span></p></button>
<button><p><span class="like-group_btn"><span id="like-04" class="like-ready like-small"></span><span class="section-title">Section 04</span></span> <span class="section-name">Lemon</span> <span class="section-type">Tart<span></p></button>
<button><p><span class="like-group_btn"><span id="like-05" class="like-ready like-small"></span><span class="section-title">Section 05</span></span> <span class="section-name">Pear and Apple</span> <span class="section-type">Muffin<span></p></button>
<button><p><span class="like-group_btn"><span id="like-06" class="like-ready like-small"></span><span class="section-title">Section 06</span></span> <span class="section-name">Chocolate and Rasberry</span> <span class="section-type">Cake<span></p></button>
<button><p><span class="like-group_btn"><span id="like-07" class="like-ready like-small"></span><span class="section-title">Section 07</span></span> <span class="section-name">Double Chocolate</span> <span class="section-type">Cheesecake<span></p></button>
<button><p><span class="like-group_btn"><span id="like-08" class="like-ready like-small"></span><span class="section-title">Section 08</span></span> <span class="section-name">Rasberry</span> <span class="section-type">Muffin<span></p></button>
</div>