feat(site-builder): tokenise colours hard-coded inside components
Component render/toHtml now use var(--wsb-*) instead of hex so Site Design palette changes reach FeaturesGrid, Testimonials, Accordion, PricingTable, CTA/CallToAction, forms, Gallery, Tabs and others. Exemption lists removed. Refs #44 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8227d768e6
commit
2877bc06fa
47 files changed
+473
-195
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import React, { CSSProperties } from 'react';
|
||||
import { tokenRef } from '../../utils/tokens';
|
||||
import { useNode, UserComponent } from '@craftjs/core';
|
||||
import { cssPropsToString } from '../../utils/style-helpers';
|
||||
import { cssValue, escapeAttr } from '../../utils/escape';
|
||||
@@ -21,8 +22,8 @@ export const StarRating: UserComponent<StarRatingProps> = ({
|
||||
rating = 4.5,
|
||||
maxStars = 5,
|
||||
size = '24px',
|
||||
filledColor = '#f59e0b',
|
||||
emptyColor = '#d1d5db',
|
||||
filledColor = tokenRef('warning'),
|
||||
emptyColor = tokenRef('border'),
|
||||
style = {},
|
||||
}) => {
|
||||
const {
|
||||
@@ -89,8 +90,8 @@ StarRating.craft = {
|
||||
rating: 4.5,
|
||||
maxStars: 5,
|
||||
size: '24px',
|
||||
filledColor: '#f59e0b',
|
||||
emptyColor: '#d1d5db',
|
||||
filledColor: tokenRef('warning'),
|
||||
emptyColor: tokenRef('border'),
|
||||
style: {},
|
||||
animation: '',
|
||||
animationDelay: '',
|
||||
@@ -123,8 +124,8 @@ StarRating.craft = {
|
||||
: 5;
|
||||
// Sanitized -- raw string-interpolation sinks in the star glyphs below.
|
||||
const size = cssValue(props.size) || '24px';
|
||||
const filledColor = cssValue(props.filledColor) || '#f59e0b';
|
||||
const emptyColor = cssValue(props.emptyColor) || '#d1d5db';
|
||||
const filledColor = cssValue(props.filledColor) || tokenRef('warning');
|
||||
const emptyColor = cssValue(props.emptyColor) || tokenRef('border');
|
||||
const wrapperStyle = cssPropsToString({
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
|
||||
Reference in new issue
Block a user