Creating Your Theme Stylesheet
Considerations when creating your theme stylesheet.
There are many aspects of QuotesDLX theming, so it's best to take a look at the sample SCSS file to get an idea of all the variations.
Sample Theme: a working sample theme named Forest is available to use as an example.
The Main CSS Wrapper
When your theme is created, QuotesDLX automatically adds a class to the base container that you can use for styling.
For example, if your theme slug is light-branded
, then the CSS class you'll want to target is: quotes-dlx-block-theme-light-branded
.
The prefix `quotes-dlx-block-theme-{slug} is a required format.
SASS File: you can check out an example of a SCSS file on GitHub.
Styling Tips
Use CSS Variables With Defaults
Your stylesheet should contain CSS variables in order to have a dynamic font size, font family, and a color palette.
Colors
For example, say that you've created a color with the slug bright-pink
. When outputting the color in CSS, you should use a CSS variable to make it dynamic.
In this case, you can reference the color by using:
The above $accent
is a default declared further up in the stylesheet (if you using SASS).
Line Height
Here's anothre example using lineheight:
Font Families
Font families can be declared globally, or for the individual theme. The priority is the per-theme options over the advanced option. This is reflected in the following:
Each theme can have a primary and secondary font.
Font Sizes
Each theme can have a font size for each breakpoint (mobile, tablet, desktop).
In the above example, you'll want to set your own breakpoints.
Setting Breakpoints
The plugin's breakpoints are as follows as defined by a mixin included with the sample theme.
An attempt was made to have dynamic breakpoints, but unfortunately the CSS spec doesn't support this.
An example using the above mixin is:
User Interface Variations
Button Variations
For the Click to Tweet button, this can be enabled or disabled. Your styles will have to reflect both.
You also have the following variations regarding the label:
Show text only
Show text with an icon
Show an icon only
For icon alignment within the button, this can be set to left or right.
And finally, the button can be left-aligned, center-aligned, or right-aligned.
Here's an example using most of the variations:
The Meatball Menu
The Meatball menu typically resides on the top right of the interface. You'll have to plan for styling this menu, as well as its pop-up.
Testing Styles
Set a Default Theme
Set your new theme as the default. You can then right+click the theme and open a preview in a new tab. Here, you can modify the theme and have a preview of your changes.
View the Theme in the Theme Options Admin Tab
Navigate to Theme Options and you'll see your default theme selected here. If it's not reflected, you can switch to the theme using the theme dropdown.
You'll see a live preview if any colors are modified.
Additionally, you can set font variations and even custom font families. Each of these can easily be previewed.
Stylesheet Conclusion
In summary, to create your own stylesheet, you should:
Plan for variations
Use CSS variables for dynamic properties
Use sane breakpoints
Preview the theme changes in the Theme Options tab
Last updated