Introduction
This documentation is a guide to theme customisation for theme developers.
There's a lot to an Evance theme. Our aim is to deliver a highly configurable theme with consistent terminology and succinct reusable code.
Text
This theme comes pre-built with the following text sizes/variations.
All font sizes on this theme scale between minimum and maximum sizes - based on rem units,
where 1rem is equal to 16px.
This allows us to have large bold headings on desktop that scale gracefully for mobile devices.
Since we now use clamp() to control font scaling, we can utilize CSS variables succinctly without the need for media queries.
Some text size modifier classes use em to allow the font to scale relative to the parent element's font size.
These are noted below.
To avoid CSS bloating, this theme only uses the size variations below.
Heading 1 |
<h1> / .heading-1
|
--heading-1-size
|
Heading 2 |
<h2> / .heading-2
|
--heading-2-size
|
Heading 3 |
<h3> / .heading-3
|
--heading-3-size
|
Heading 4 |
<h4> / .heading-4
|
--heading-4-size
|
Heading 5 |
<h5> / .heading-5
|
--heading-5-size
|
Heading 6 |
<h6> / .heading-6
|
--heading-6-size
|
|
Eyebrow |
.text-eyebrow
|
--text-eyebrow-size
|
|
Subtitle |
.text-subtitle
|
--text-subtitle-size
|
|
Large |
.text-large
- scales relative to parent font-size.
|
--text-large-size
|
|
Medium |
Default |
--text-size
|
|
Small |
.text-small
- scales relative to parent font-size.
|
--text-small-size
|
| 100m2 |
<sup>
|
|
| 100m2 |
<sub>
|
Lists
Avoid applying complex styles to the default ordered and unordered lists. Use modifider classes instead.
Unordered lists
(default)
<ul>
Ordered lists
(default)
<ol>
Tick lists
<ul class="list-ticks">
Icons
There are two methods of implementing icons in this theme:
<i class="icon"><ev:icon>How and when to use each are outlined below.
Modifier classes for icons work on both method of implementing icons.
Web font icons use the .icon class.
~/theme/common/fonts/spark-icons/selection.json contains all icon data
which can be managed via IcoMoon.
To make changes load the selection.json file into IcoMoon, load/change your icons. Then, import the resulting web fonts
into Evance and modify the style.css file as required.
When importing new SVGs into IcoMoon be sure to reset any fill properties to
currentColor unless the design requires coloured icons.
Web font based icons are required for some UI elements. For example, the select icon is used by drop-down menus.
SVG icons use the
<ev:icon> tag
in conjunction with your theme's
Icon Registry
.
General
Brand
SVG icons are currenly used in non-editable regions and allow you to customize the look-and-feel of the UI even within shared/protected templates.
If you would like to add custom SVG icons to your theme, it is recommended to add these into a custom
prefix to avoid conflicts with changes to Evance's default icon registry. For example, if you wanted an icon representing
delivery, use <ev:icon ref="custom.delivery" />.
Icons in Evance themes have a standardized default size of 24×24px.
If you require a different size use a .size-* modifier class.
If you wish to change the pre-built sizes, you can modify the CSS variable
values in ~/theme/common/css/variables.css.
.size-small |
--icon-size-small |
|
| Default | --icon-size |
|
.size-large |
--icon-size-large |
|
.size-xl |
--icon-size-xl |
Buttons
Some buttons are associated with Evance's built-in <ev:button>,
which are used for Forms and Checkout. However, some are custom to this theme.
Evance's built-in <ev:button> styles support buttons as <button> or as a <a>
depending on whether an href attribute is supplied. Below, we output both so you can ensure styling for both tag types
is identical in appearance.
<button> |
<a> |
|
|---|---|---|
| Subtle button |
|
|
| Default button |
|
|
| Action button |
|
|
| Proceed button | ||
| Danger button |
|
|
| Inverse button |
|
The .shape-round modifier is intended for use with icon buttons, or numbering (e.g. with pagination).
Using a .size-* modifier.
Use the .is-loading modifier only with <ev:button> when implementing load interactions.
The <ev:button> tag supports both webfont and SVG icons.
<ev:button icon="cart" value="Add to cart" />
|
|
<ev:button icon-end="go.forward" value="Continue" />
|
|
<ev:button icon-start="cart" icon-end="go.forward" value="Continue" />
|
|
<ev:button icon="wishlist.off" class="shape-round" />
|
Forms
Input fields MUST have a minimum font-size of 16px/1rem to avoid zoom-in on focus on mobile devices.
<ev:textfield>
Text fields should default to full-width of their available space and should have the same size variations as <ev:button>.
<ev:textarea>
Text areas should have the same border and highlights as <ev:textfield>.
<ev:switch>
<ev:checkbox>
<ev:radio>
<ev:select>
memberships & certifications