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:
color: var( --qdlx-bubble-gum-accent, $accent );
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
Options for Variations in Appearance
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
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.
Expanded Meatball Menu
Testing Styles
Set a Default Theme
Setting 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.
Preview on its own Tab
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.
Theme Switcher 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.
Setting Colors and Desktop Sizes
Setting Custom Font Families
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
/* Responsive styles - In hindsight, should've used mobile-first */
/* Mixin from: https://css-tricks.com/snippets/sass/mixin-manage-breakpoints/ */
/* It's only used here, so no external file for mixin? */
$breakpoints: (
'xs': 420px,
'small': 520px,
'medium': 768px,
'large': 1024px,
'xl': 1200px,
'xxl': 81.1400px
) !default;
@mixin respond-to($breakpoint) {
// If the key exists in the map
@if map-has-key($breakpoints, $breakpoint) {
// Prints a media query based on the value
@media (min-width: map-get($breakpoints, $breakpoint)) {
@content;
}
}
// If the key doesn't exist in the map
@else {
@warn "Unfortunately, no value could be retrieved from `#{$breakpoint}`. "
+ "Available breakpoints are: #{map-keys($breakpoints)}.";
}
}