Jump to content

Change login text to an icon

Recommended Posts

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️ Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment

Recently I solved for a member on forum, this is code I used (I used Google Fonts Icon)

Website Tools (under Not Linked) > Code Injection > Footer

<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200">
<style>
span.unauth {
    font-size: 0
}

span.unauth:before {
    content: "\e7fd";
    font-family: 'Material Symbols Outlined';
    font-size: 30px;
    position: relative;
    left: -2px;
    top: 10px
}
</style>

image.png.6c928df61b66da6060236a3c837f6452.png

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 12/27/2023 at 1:09 AM, saubuchon24 said:

@tuanphan Wow! thank you! is there any way for it to just say Login instead of the icon for mobile, I just want the Icon there on desktop. I'm not sure if media screens work on code injection...

Thank you!

https://refreshedmemories.squarespace.com

password: RMWEB

Remove above code & use this new code

<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200">
<style>
.header-display-desktop span.unauth {
    font-size: 0
}
.header-display-desktop span.unauth:before {
    content: "\e7fd";
    font-family: 'Material Symbols Outlined';
    font-size: 30px;
    position: relative;
    left: -2px;
    top: 10px
}
</style>

 

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 1 month later...
41 minutes ago, Gray_tan said:

tried multiple codes to change "Login" text into icons, .png.jpg. - doesnt work

@Gray_tan Please provide more details. It will help us if you include:

  • a link to the icon you are trying to use
  • a link to your website
  • a link to the code you have tried
  • a description or screenshot of what happens when you use the code.

The more you tell us, the easier for us to help 🙂

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Would you like your customers to be able to mark their favourite products in your Squarespace store?

Link to comment

@paul2009

1. https://static1.squarespace.com/static/65bc845aeef21c331795b4d2/t/65d47059624f260b5829e01c/1708421209869/Untitled+design.jpg

2. https://www.theroadofmarriage-sg.com/

3. /* Hide the login text */
.header-actions-action--account > a > span {
    visibility: hidden;
}

/* Insert background image as icon */
.header-actions-action--account > a:before {
    content: '';
    background-image: url('your_icon_url_here'); /* Replace 'your_icon_url_here' with the URL of your icon image */
    display: inline-block;
    width: 30px; /* Adjust width as needed */
    height: 30px; /* Adjust height as needed */
    background-size: cover;
    vertical-align: middle; /* Adjust vertical alignment as needed */
}

4. nothing happens when i use above code. I need the "login" text to change into icon

Link to comment
13 minutes ago, Gray_tan said:

nothing happens when i use above code. I need the "login" text to change into icon

There are a few issues here:

  1. Squarespace updated the header and changed the 'class' for the desktop account link from .header-actions-action--account to .user-accounts-link, so this must be changed within your CSS snippet.
  2. In your code there's a line that includes "your_icon_url_here" where you'll need to substitute the url of your image.
  3. Your image is a JPEG with a white background so you'll probably want to upload a PNG alternative that has a transparent background.

Once you've made those changes, paste it into the Custom CSS panel and it should work. That said, I also recommend changing visibility: hidden to display:none otherwise this missing "login" text will still consume space in the header 🙂.

For example:

/* Hide the login text */
.user-accounts-link > a > span {
  display:none;
}

/* Insert background image as icon */
.user-accounts-link > a:before {
    content: '';
    background-image: url('//static1.squarespace.com/static/65bc845aeef21c331795b4d2/t/65d47059624f260b5829e01c/1708421209869/Untitled+design.jpg'); 
    display: inline-block;
    width: 30px; /* Adjust width as needed */
    height: 30px; /* Adjust height as needed */
    background-size: cover;
    vertical-align: middle; /* Adjust vertical alignment as needed */
}

Did this help? Please give feedback by clicking an icon below  ⬇️

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Would you like your customers to be able to mark their favourite products in your Squarespace store?

Link to comment

@paul2009 cheers sir, it works. Truly appreciate your help 😁 my deepest apologies in adding on a few other requests:

1. mobile view: isit possible to add the "shopping cart" icon on the top right hand corner of my webpage?

2.mobile view: can i increase the "shopping cart" icon size purely on mobile only?

image.png.be90832099d409e8e56845428eaf5382.png

code used:

div.header-actions-action--cart>a {
    position: fixed;
    bottom: 70px;
    right: 20px;
}
/* Apply the rule for screens smaller than or equal to 768px (typical tablet portrait size) */
@media (max-width: 768px) {
    div.header-actions-action--cart>a {
    }

Link to comment
9 minutes ago, Gray_tan said:

my deepest apologies in adding on a few other requests:

I recommend you start a new thread for those requests.

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Would you like your customers to be able to mark their favourite products in your Squarespace store?

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.