@techrox/page-studio-blocks 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techrox/page-studio-blocks",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "50 production-ready content blocks (Hero, Pricing, FAQ, Contact, …) plus the Puck config builder for @techrox/page-studio. SSR-safe, brand-themable via CSS variables, host-extensible.",
5
5
  "license": "MIT",
6
6
  "author": "techrox",
package/src/styles.css CHANGED
@@ -44,6 +44,102 @@
44
44
  background: var(--tps-bg-soft);
45
45
  }
46
46
 
47
+ /* -------------------------------------------------------------------------
48
+ Themes
49
+ -------------------------------------------------------------------------
50
+ A theme is nothing more than a re-scoped set of the *neutral* tokens
51
+ (ink / muted / line / bg / …). Brand tokens (--tps-primary, --tps-accent)
52
+ are deliberately left alone, so every vendor keeps its hue in every theme.
53
+
54
+ Apply a theme by setting `data-tps-theme="<name>"` on ANY container — the
55
+ renderer root, a page wrapper, a single section. Every descendant block
56
+ reads var(--tps-*) and re-paints automatically: no per-block code, no
57
+ re-render, just the CSS cascade. That's the whole mechanism, and it scales
58
+ — adding a new theme is one rule below, nothing else changes.
59
+
60
+ <div data-tps-theme="dark"> … blocks … </div>
61
+
62
+ The same token set also backs the per-section opt-in `background:'dark'`
63
+ (.tps-section-dark) so a single light page can drop one dark section.
64
+
65
+ To ADD a theme (e.g. "sepia"): copy the dark rule, rename the selector to
66
+ `[data-tps-theme="sepia"], .tps-section-sepia`, and change the values.
67
+ Nothing in the blocks needs to know the theme exists.
68
+ ------------------------------------------------------------------------- */
69
+
70
+ /* Explicit light = the :root defaults, restated so a light island can be
71
+ nested inside a dark container via data-tps-theme="light". */
72
+ [data-tps-theme="light"] {
73
+ --tps-ink: #0f172a;
74
+ --tps-ink-2: #334155;
75
+ --tps-muted: #64748b;
76
+ --tps-hint: #94a3b8;
77
+ --tps-line: #e2e8f0;
78
+ --tps-bg: #ffffff;
79
+ --tps-bg-soft: #fafaf7;
80
+ --tps-bg-section: #f8fafc;
81
+ }
82
+
83
+ /* Dark theme. Shared by the container scope and the per-section opt-in. */
84
+ [data-tps-theme="dark"],
85
+ .tps-section-dark {
86
+ --tps-ink: #f1f5f9;
87
+ --tps-ink-2: #cbd5e1;
88
+ --tps-muted: #94a3b8;
89
+ --tps-hint: #64748b;
90
+ --tps-line: #262626;
91
+ --tps-bg: #141414;
92
+ --tps-bg-soft: #1a1a1a;
93
+ --tps-bg-section: #0a0a0a;
94
+ --tps-primary-soft: #1a1a1a;
95
+ }
96
+ /* A container theme paints its own backdrop; the per-section variant paints
97
+ its surface (it's a section wrapper, not just a token scope). */
98
+ [data-tps-theme="dark"] {
99
+ background: var(--tps-bg-section);
100
+ color: var(--tps-ink);
101
+ }
102
+ .tps-section-dark {
103
+ background: #0a0a0a;
104
+ color: var(--tps-ink);
105
+ }
106
+ /* Eyebrows are primary by default — low contrast on dark, so flip to accent. */
107
+ [data-tps-theme="dark"] .tps-eyebrow,
108
+ .tps-section-dark .tps-eyebrow {
109
+ color: var(--tps-accent);
110
+ }
111
+ /* AntD form controls on a dark surface (form blocks). */
112
+ [data-tps-theme="dark"] .ant-input,
113
+ [data-tps-theme="dark"] .ant-input-number,
114
+ [data-tps-theme="dark"] .ant-input-affix-wrapper,
115
+ [data-tps-theme="dark"] .ant-picker,
116
+ [data-tps-theme="dark"] .ant-select-selector,
117
+ .tps-section-dark .ant-input,
118
+ .tps-section-dark .ant-input-number,
119
+ .tps-section-dark .ant-input-affix-wrapper,
120
+ .tps-section-dark .ant-picker,
121
+ .tps-section-dark .ant-select-selector {
122
+ background: #1a1a1a !important;
123
+ border-color: #2e2e2e !important;
124
+ color: #f1f5f9 !important;
125
+ }
126
+ [data-tps-theme="dark"] .ant-input::placeholder,
127
+ [data-tps-theme="dark"] .ant-select-selection-placeholder,
128
+ [data-tps-theme="dark"] .ant-picker-input > input::placeholder,
129
+ .tps-section-dark .ant-input::placeholder,
130
+ .tps-section-dark .ant-select-selection-placeholder,
131
+ .tps-section-dark .ant-picker-input > input::placeholder {
132
+ color: #64748b !important;
133
+ }
134
+ [data-tps-theme="dark"] .ant-form-item-label > label,
135
+ [data-tps-theme="dark"] .ant-checkbox-wrapper,
136
+ [data-tps-theme="dark"] .ant-radio-wrapper,
137
+ .tps-section-dark .ant-form-item-label > label,
138
+ .tps-section-dark .ant-checkbox-wrapper,
139
+ .tps-section-dark .ant-radio-wrapper {
140
+ color: #cbd5e1 !important;
141
+ }
142
+
47
143
  .tps-eyebrow {
48
144
  display: inline-block;
49
145
  font-size: 12px;
@@ -203,7 +299,7 @@
203
299
  padding: 0;
204
300
  border: 1px solid var(--tps-line);
205
301
  border-radius: var(--tps-radius);
206
- background: #fff;
302
+ background: var(--tps-bg);
207
303
  overflow: hidden;
208
304
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
209
305
  }