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';
|
||||
|
||||
@@ -9,7 +10,7 @@ interface DividerProps {
|
||||
}
|
||||
|
||||
export const Divider: UserComponent<DividerProps> = ({
|
||||
color = '#e4e4e7',
|
||||
color = tokenRef('border'),
|
||||
thickness = '1px',
|
||||
style = {},
|
||||
}) => {
|
||||
@@ -39,7 +40,7 @@ export const Divider: UserComponent<DividerProps> = ({
|
||||
Divider.craft = {
|
||||
displayName: 'Divider',
|
||||
props: {
|
||||
color: '#e4e4e7',
|
||||
color: tokenRef('border'),
|
||||
thickness: '1px',
|
||||
style: {},
|
||||
},
|
||||
@@ -55,7 +56,7 @@ Divider.craft = {
|
||||
(Divider as any).toHtml = (props: DividerProps, _childrenHtml: string) => {
|
||||
const styleStr = cssPropsToString({
|
||||
border: 'none',
|
||||
borderTop: `${props.thickness || '1px'} solid ${props.color || '#e4e4e7'}`,
|
||||
borderTop: `${props.thickness || '1px'} solid ${props.color || tokenRef('border')}`,
|
||||
margin: '16px 0',
|
||||
...props.style,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user