CSSPreset

CSSPreset()

CSSPRESET Named CSS style presets for CSSBase components

Usage:

btn = CSSuiButton(parent, ‘Style’, ‘shadow’); % by name btn = CSSuiButton(parent, ‘Style’, CSSPreset.shadow()); % by object p = CSSPreset.flat(); p.Color = ‘#2a7a2a’; btn.setStyle(‘neon’);

Inputs:

(static factories — no arguments; set properties on the returned object)

Outputs:

p : CSSPreset - pure data container with convenience properties and CSS string

Notes

A CSSPreset has no behaviour beyond static factory methods. Pass it to any CSSBase component via the ‘Style’ argument.

Available presets:

CSSPreset.shadow() - Neumorphic raised-shadow (default) CSSPreset.flat() - Clean flat modern style CSSPreset.glass() - Frosted-glass / glassmorphism CSSPreset.neon() - Cyberpunk dark with glowing cyan borders CSSPreset.pill() - Rounded pill with solid purple accent CSSPreset.dark() - Dark-mode flat (VS Code style) CSSPreset.list() - Cell array of preset names

A preset sets convenience properties (Color, BackgroundColor, …) and appends a CSS string that targets the standard schema selectors: .css-surface, .css-clickable, .css-label, plus the widget-type classes .cssui-button, .cssui-edit, .cssui-numeric, .cssui-textarea, .cssui-dropdown, .cssui-listbox, .cssui-checkbox, .cssui-switch, .cssui-radio, .cssui-search, .cssui-table, .cssui-tree, .cssui-progressbar, .cssui-label (one is set on every widget’s #css-root). A single preset can therefore style buttons and inputs differently:

p.CSS = [‘.cssui-button .css-surface{background:#ececec;}’ …

‘.cssui-edit .css-surface{background:#ffffff;}’];

Utility methods scaleShadow(shadow, factor) and invertShadow(shadow) manipulate shadow strings.

See also: CSSBase, CSSuiButton, CSSuiDropdown, CSSuiEditField, CSSuiSwitch

∿∿∿ Prerau Laboratory MATLAB Codebase · sleepEEG.org ∿∿∿