User account styles
This topic introduces you to the CSS classes for each UI component used in the user account drop-in component and shows you how to override these classes to customize the user account component’s CSS styling to match your brand.
Big Picture
The quickest way to override user account CSS is to inspect the user account UI from your browser’s developer tools to discover the BEM class names you want to add to or override. This process is numbered in the image below.
- Inspect the element in the UI that you want to customize (right-click on the element and select “Inspect” from the menu).
- Identify the CSS class(es) for the element. We use BEM naming, which makes it easy to know which component you’re changing (and which CSS file to use).
- Copy the CSS class names to override to your custom CSS file.
How to override the default styles
Create a new CSS file in your project for the user account component. Name the file
custom-account.css
.Copy the BEM class names displayed in the Element tab of the developer panel into your new file.
Add your custom CSS rules to the
custom-account.css
file to add or override the default styles.Import the custom CSS file into the
commerce-account.css
file.Save the file and refresh your browser to see the changes.
Example CSS overrides
The following example shows how to override two of the many classes for the user account component.
Account CSS classes
The CSS classes for each user account component are provided here.