How to: your own colours, font and pill buttons in Storefront (child theme) #576
navjottomer
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Storefront's settings give you three palettes and a light/dark choice. To match another site exactly (your own colours, font and button shape), use a small child theme. It is one CSS file on top of Storefront, and Storefront updates do not overwrite it.
The example below sets:
#D10000(red), secondary colour#FCBF11(yellow)#0B0B0DIt is tested on Storefront 2.2.0, in light and dark mode.
1. Make the folder
Create
oc-content/themes/storefront-custom/with three files. You can also download the ready folder (storefront-custom.zip, at the end of this post) and change the colours.index.phpfunctions.phpcss/custom.css2. Turn it on
Using your own colours
--color-accent-*set. Secondary is the--color-accent-2-*set. Put your colour at500and on-fill. Make100to400lighter steps and600to900darker steps. Any "tints and shades" tool makes these for you.--color-accent-inkand--color-accent-2-inkare for text in those colours, such as links. Pick a step that is easy to read on your background: a dark step on light mode, a light step on dark mode.--color-bg. Cards use--color-surface. The--color-neutral-*steps colour borders, chips and muted text. Keep them in the same tone as your background, or you get a tinted edge..sf-btn--accent.Font without Google
To serve the font yourself, put the
.woff2files instorefront-custom/fonts/. Then replace the@importline with an@font-facerule that points at../fonts/your-file.woff2.More
We may add colour, font and button-shape settings to Storefront itself later. Until then, this is the safe way to brand it.
storefront-custom.zip
All reactions