Appearance
Style Editor
The WP-Nexus style editor lets you visually configure CSS styles for every widget element. It supports responsive design with breakpoints, element states (hover, focus, active), and expression-based visibility rules.
Overview
Every widget in WP-Nexus has a Styles panel in the right sidebar. The panel is organized into sections:
- Layout -- Display, flexbox, grid, and positioning.
- Spacing -- Margin and padding.
- Size -- Width, height, min/max dimensions.
- Typography -- Font, text color, size, weight, alignment.
- Background -- Background color, image, gradient.
- Border -- Border width, color, radius.
- Effects -- Opacity, box shadow, transform.
How Styles Are Applied
Styles are compiled into CSS classes at render time. Each element gets a unique class name with its styles applied inline in a <style> block. This approach:
- Avoids inline
styleattributes (better for CSP compliance). - Supports responsive breakpoints via
@mediaqueries. - Supports pseudo-states (
:hover,:focus, etc.) which cannot be done with inline styles.
Responsive Design
Styles can be set per breakpoint:
- Desktop (default) --
min-width: 1024px - Tablet --
768pxto1023px - Mobile -- Below
768px
Element States
Styles can vary by state:
- Default -- Normal appearance.
- Hover -- When the mouse hovers over the element.
- Focus -- When the element has keyboard focus.
- Active -- While being clicked/pressed.
- Custom -- Expression-based CSS classes (e.g., applied when a condition is true).
Visibility Rules
Elements can be shown or hidden based on visibility rules:
- Always visible -- The default.
- Expression -- Show/hide based on an expression (e.g.,
row.status == 'active'). - Logged in -- Only show to authenticated users.
- Logged out -- Only show to anonymous visitors.
Further Reading
- CSS Properties -- Full list of supported CSS properties.
- Responsive Breakpoints -- How to build responsive layouts.
- Element States -- Hover, focus, active, and custom states.
- Visibility Rules -- Conditional element visibility.