PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.2
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.2
1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 All 34 releases
desktop-mode / assets / js / widget-starter.css

widget-starter.css in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.2, at assets/js/widget-starter.css

122 lines 4.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*
2 * =============================================================================
3 * OpenStation — Starter Widget styles
4 * =============================================================================
5 *
6 * NAMING CONVENTION
7 * -----------------
8 * Prefix every class with a short namespace unique to your widget.
9 * This file uses "dm-starter__" — change it to match your widget name.
10 * Without a prefix, your styles can collide with the shell's own classes
11 * or another plugin's widget running on the same page.
12 *
13 * CSS CUSTOM PROPERTIES
14 * ---------------------
15 * OpenStation sets these variables on the card body element. Using them
16 * means your widget automatically respects the user's chosen theme
17 * (light, dark, or any custom accent colour) without any extra code.
18 *
19 * --os-ui-color-text Primary text — body copy, headings
20 * --os-ui-color-text-subtle Muted text — labels, timestamps, metadata
21 * --os-ui-color-border Divider lines and borders
22 * --os-ui-color-accent Brand blue — use for buttons, highlights, links
23 * --os-ui-color-surface The card's glass background (rarely needed)
24 *
25 * Always provide a fallback value as the second argument to var() in case
26 * the shell loads in an unexpected context:
27 * color: var(--os-ui-color-text, #1a1a1a);
28 *
29 * LAYOUT
30 * ------
31 * The card body is a block-level element with 12px padding on all sides.
32 * Your root element should fill it completely:
33 * height: 100%; display: flex; flex-direction: column;
34 *
35 * Use flex: 1 on the main content area so it expands to fill available
36 * space, and flex-shrink: 0 on fixed-height elements like headers and
37 * footers so they do not compress when the card is resized small.
38 *
39 * RESPONSIVE SIZING
40 * -----------------
41 * When a widget is resizable, the card can be made very small by the user.
42 * Use min-width: 0 on flex children that contain text so they truncate
43 * cleanly rather than overflowing. Use white-space: nowrap + overflow:
44 * hidden + text-overflow: ellipsis on single-line text that must not wrap.
45 *
46 * Avoid fixed pixel widths on any element the user might resize. Use
47 * percentage widths or flex layout so the widget reflows gracefully.
48 */
49
50 /* Root container — fills the card body and stacks children vertically. */
51 .dm-starter {
52 display: flex;
53 flex-direction: column;
54 gap: 10px;
55 height: 100%;
56 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
57 font-size: 13px;
58 color: var(--os-ui-color-text, #1a1a1a);
59 /* Prevent the root from exceeding the card body width. */
60 min-width: 0;
61 }
62
63 /*
64 * Header bar — small, uppercase label that identifies the widget.
65 * flex-shrink: 0 keeps it at a fixed height even when the card is tiny.
66 * This pattern (header + flex:1 body + optional footer) is the standard
67 * layout used by all the built-in widgets.
68 */
69 .dm-starter__header {
70 font-weight: 600;
71 font-size: 11px;
72 text-transform: uppercase;
73 letter-spacing: 0.06em;
74 color: var(--os-ui-color-text-subtle, #6b7280);
75 padding-bottom: 8px;
76 border-bottom: 1px solid var(--os-ui-color-border, #e5e7eb);
77 /* Fixed height — does not grow or shrink with the card. */
78 flex-shrink: 0;
79 /* Truncate if the label is too wide for a very narrow card. */
80 white-space: nowrap;
81 overflow: hidden;
82 text-overflow: ellipsis;
83 }
84
85 /*
86 * Main content area — flex: 1 makes this fill all remaining vertical space
87 * between the header and the counter button below it.
88 * min-width: 0 prevents text from overflowing its flex container.
89 */
90 .dm-starter__body {
91 flex: 1;
92 font-size: 12px;
93 line-height: 1.5;
94 color: var(--os-ui-color-text, #1a1a1a);
95 min-width: 0;
96 /* Allow long post titles to wrap rather than overflow. */
97 overflow-wrap: break-word;
98 }
99
100 /*
101 * Counter button — demonstrates using --os-ui-color-accent for interactive
102 * elements so the button colour matches the user's chosen shell accent.
103 * flex-shrink: 0 keeps it at its natural height at the bottom of the card.
104 */
105 .dm-starter__counter {
106 flex-shrink: 0;
107 background: var(--os-ui-color-accent, #3b82f6);
108 color: #fff;
109 border: none;
110 border-radius: 6px;
111 padding: 6px 12px;
112 font-size: 11px;
113 font-weight: 600;
114 cursor: pointer;
115 /* Subtle hover/active feedback without JavaScript. */
116 transition: opacity 0.15s ease;
117 /* Prevent the button from stretching full width in a flex column. */
118 align-self: flex-start;
119 }
120 .dm-starter__counter:hover { opacity: 0.85; }
121 .dm-starter__counter:active { opacity: 0.70; }
122