Supported Versions: The details shared in this article apply to the updated version of eComm Performance.
Using the Custom CSS Feature
Within the Theme Editor (Customize), the eComm Performance theme allows you to add components and sections throughout your site with your own Custom CSS. This is a helpful took to tweak the section designs a little bit. You can create your own CSS to customize your site once you are comfortable with the CSS feature.
When you see this in the "Advanced" area of the theme editor, you will be aware that custom CSS is available.
These two fields will only apply to the element that the fields are found in. For example, if you add an "Image with Text Overlay" area and use the CSS Class and Custom CSS in the section settings, it will only show up in that specific setting.
Please note: The Custom CSS field does not accept SCSS/SASS or media queries and mixins.
How does the Custom CSS Feature work?
There are various ways that you can make use of the advanced CSS feature.
1. Create a brand new CSS Class, and add in Custom CSS
You can create your own CSS Class by entering it in the "CSS Class" field. In the "Custom CSS" field, you can write your CSS by adding in the class selector with declarations to apply the styles.
Example 1
In this example, a black border was created around the entire Image with Text section. There was some additional padding between the section content and the border:
CSS Class:
image-with-text-border
Custom CSS:
.image-with-text-border { border: 10px solid black; padding: 50px; }
2. Target and apply CSS to other elements/selectors in the section
You also have the option to utilize the "Custom CSS" field to highlight other elements within the section and apply different styles. For example, if you wanted to make the text's color within a section different, you can target the <p> area.
Example 1
In this example, the body text in the "Who is Shop Style design?" section is targeted in the "Custom CSS" field:
Custom CSS:
p {color: #006400; }
Example 2
In this example, the Customer Testimonial section is being used in the 'Custom CSS' field to create a border with padding. The 'CSS Class' field is not used:
Custom CSS
{
border: 10px solid pink;
padding: 20px;
}
3. Borrowing custom styles from your styles.scss.liquid file
If you've created any customized styles in your styles.scss.liquid file (Themes > Edit Code > Assets), you can add that class name to the "CSS Class" field and it will apply the styles to the selected section. Unless you want to add more CSS, you do not need to add anything in the "Custom CSS" field!
Example 1
This example shows that a custom style has been created in the styles.css.liquid file called light-gradient-background:
This custom class name gets added into the "CSS Class" field, and the styles get applied to the section:
4. An easy way to hide sections on desktop/mobile
Take a look at
this article, which talks about using the Custom CSS feature to hide sections on your desktop and mobile.