Customize Your Desktop Popup with CSS

Who gets this? Shops on all Postscript plans have access to this feature. Learn more about Postscript Plans.

Postscript makes it easy to customize your desktop popup to match the look and voice of your brand with cascading style sheets (CSS). By adding CSS to your popups, you can:

  • Have more control over the customizations and appearance of your popup to perfectly match your brand and website design.
  • Create a more engaging experience for your visitors.
  • Design your popup for an upcoming holiday, special giveaway, or feature product images for a new product drop.

We designed this guide as a reference to help you understand and locate the various HTML and CSS elements present in our desktop popups.

Access Your Desktop Popup CSS Editor


FindDesktopCSSEditor.gif

  1. Select Acquisition in the side menu of your Postscript dashboard, then select Popups.
  2. Choose the desktop popup that you would like to add CSS to. If you haven't created a popup yet, start here
  3. On the popup details page, select Edit CSS in the top-right corner. By default, Postscript lists several elements in the CSS editor. You can remove these, use any listed elements to change the design of your popup, or add additional ones as you see fit.
  4. When you're ready to save and implement your edits, select the Overwrite button above the CSS code editor. 

Customize Popup Font


When it comes to customizing your font, you can import a font from Shopify or from Google Fonts, or you can define an existing font family. We cover all three options below.

Import Shopify Font Import Google Font Define Existing Font

When using Shopify font(s) in your popup, you'll first need to import the font, then you can define where that font should be used. We break down these two steps below.

Shopifyfont-dekstop.gif

  1. To import your Shopify font into your desktop popup CSS editor, navigate to your shop's homepage. Right click on the page and select View page source
  2. In your page source, using the Search functionality (Command+F on Mac or Ctrl+F on PC), search for font-face.
  3. Locate, highlight, and copy the font(s) you'd like to import from Shopify. These will begin with @font-face and end with a source URL, followed by a left-facing curly bracket. View an example of what this code may look like below.
  4. Navigate to your desktop popup in Postscript. Copy and paste the below code into your CSS code editor in Postscript.
  5. You've just imported your Shopify font. Now, you can reference this font when isolating and adjusting the copy on your popup.  
      @font-face {
  font-family: Assistant;
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("//www.exampleshop.com/cdn/fonts/assistant/assistant_n4.bcd3d09dcb631dec.woff2?h1=cGlsb3RzaG9waWZ5d3d3Lm5ld2VyYWNhcC5jb20&h2=bmV3ZXJhY2FwLmNvbQ&h3=zaG9waWZ5LmNvbQ&hmac=590db6") format("woff2"),
       url("//www.exampleshop.com/cdn/fonts/assistant/assistant_n4.a2d012304becc2a.woff?h1=cGlsb3RzaG9waWZ5d3d3Lm5ld2VyYWNhcC5jb20&h2=bmV3ZXJhY2FwLmNvbQ&h3=zaG9waWZ5LmNvbQ&hmac=07c2dd6") format("woff");
}

Once your Shopify font is imported, you can assign that font to specific elements in your popup. In this section, we'll provide the code for those elements.

desktopcsseleemtns.png

The text in blue is the code snippet you can inject into your CSS editor to isolate a specific element of your popup. The text in red is the code you'll use to call the font family you imported earlier in this article. Please note: Helvetic Neue Condensed is a placeholder.

# Element Name Code Snippet
1 Pre-headline
#ps-widget-custom-form__pre-headline {
font-family: 'Helvetica Neue Condensed';
}
2 Headline
#ps-widget-custom-form__headline {
font-family: 'Helvetica Neue Condensed';
}
3 Post-headline
#ps-widget-custom-form__post-headline {
font-family: 'Helvetica Neue Condensed';
}
4 Phone Number Placeholder Text
#ps-widget-custom-form__phone-question {
font-family: 'Helvetica Neue Condensed';
}
5 Disclaimer Language
#ps-widget-custom-form__disclaimer-text {
font-family: 'Helvetica Neue Condensed';
}
6 Button text
#ps-widget-custom-form__submit-button {
font-family: 'Helvetica Neue Condensed';
}
7 Close button text
#ps-widget-custom-form__close-button {
font-family: 'Helvetica Neue Condensed';
}

Important: If you change your Shopify theme, you will need to re-import your new theme's Shopify font in order for your popup to inherit the correct font from your website.

Customize Text Size


You can customize font size for any of our font-related popup IDs. This includes your pre-headline, headline, post-headline, and disclaimer text.

Font size requires a percentage value. With Postscript's dynamic editing display, you can view changes you make to the size in real-time. This means you can adjust the percentage a few times if needed until you reach your desired size.

Pre-Headline Headline Post-Headline Disclaimer Text

Copy and paste the following code snippets into your CSS Editor and adjust the font size as desired.

#ps-widget-custom-form__pre-headline {
    font-size: 200%;
 }

Customize Text Color


The ability to customize text color is important, especially if you're using a dark background color or an image.

When you define color, you have the option to do so by the color's name or, if you have branded colors, you can use a specific hex code.

When defining font color, you want to specify which popup element you wish to appear in the defined color. You can do so using the element ID

Pre-Headline Headline Post-Headline Disclaimer Text

Copy and paste the following code snippets into your CSS Editor and adjust the font color as desired.

The below snippet uses the color name.

#ps-widget-custom-form__pre-headline {
    color: red;
 }

The below snippet defines a shade of red using a specific hex code.

#ps-widget-custom-form__pre-headline {
    color: #C0392B;
 }

Change Logo Size


Once you've uploaded an image of your logo in Postscript's standard popup editor, you can adjust the size of the logo until it looks just right on the popup.

Just like when you adjust text size, changes to logo sizing updates in real-time in the dynamic editing display. This means you can adjust the percentage a few times if needed until you reach your desired size.

Copy and paste the below code snippets into your CSS Editor and adjust the logo size as desired.

#ps-widget-custom-form__logo-image {
   width: 25%;
}

Add URL-Hosted Background Image


Postscript's standard desktop popup editor allows you to upload a background image with a file size of less than 2 MB. If you try to upload an image larger than 2 MB, your upload will error out. Luckily, you can use CSS to add your desired background image.

Before you head to the code, you'll need to host the image somewhere that allows for it. We recommend uploading your image to your Shopify files.

Upload Image to Shopify Use CSS to Add Background Image

AddFiletoShopify.gif

  1. From your Shopify dashboard, select Content on the left-side navigation panel.
  2. Select Files
  3. Select Upload Files in the top-right corner of the page. Locate the image on your device and continue.
  4. Once Shopify has successfully uploaded your image, select the Link icon to the far-right of the image line. 
  5. With the image URL copied, you are ready to paste it into your CSS code.

Edit Phone and Email Input Fields


If you've added a custom background image, or if you have a background color that makes it difficult to see the phone or email input fields, then you might consider editing the color of these fields. 

As with text color, you can enter the name of a color or if you have branded colors, you can enter a hex code.

Phone Input Field Email Input Field

borderradiusdesktop.png

When adding a color to the background of your phone input field, you'll notice 90 degree corners as shown in the middle popup example labeled "No Border Radius". By adding specifications to the border, you can be sure the background color applies to the rounded input field only.

Copy and paste the following code snippets into your CSS Editor and adjust the field color as desired.

.ps-widget-custom-form__phone-question{
background-color: #red;
border-radius: 40px;
}

Compliance Language Requirements


When collecting subscribers, the TCPA requires you to include necessary compliance language that informs visitors that they are opting into SMS messaging from your store.

You must include compliance language on your desktop popup.

Here's the TCPA-approved compliance language:

*By providing your phone number, you agree to receive recurring automated marketing text messages (e.g. cart reminders) from this shop and third parties acting on its behalf. Consent is not a condition to obtain goods or services. Msg & data rates may apply. Msg frequency varies. Reply HELP for help and STOP to cancel. You also agree to the Terms of Service and Privacy Policy.

Note: In order to collect subscribers compliantly, your shop's Terms of Service and Privacy Policy need to be hyperlinked in the language shown above. If they cannot be hyperlinked, the full URLs of each need to be included so a viewer may search your terms or privacy policy if needed.

For example, "You also agree to the Terms of Service (https:/myshop.com/terms-of-service/) and Privacy Policy (https://myshop.com/privacy-policy/).”

Additional Resources


  • Interested in further customization with CSS? Check out our CSS Glossary to better understand and locate the various HTML and CSS elements present in our popups.
  • Just getting started with designing your desktop popup? Check out our template gallery for CSS codes and inspiration.
  • Did you know you can customize your Back in Stock popup with CSS? Learn how with this article

Get Support


Have questions? Please feel free to reach out to our wonderful Support team at support@postscript.io or via live chat. You can also submit a support request here!

Need ongoing channel strategy guidance? Please fill out this form and we'll connect you to one of our certified partners.

Was this article helpful?
0 out of 1 found this helpful