-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the global styles preview to the sidebar #34991
Conversation
const fontSize = getStyle( 'root', 'fontSize' ) ?? 'initial'; | ||
const textColor = getStyle( 'root', 'color' ) ?? 'black'; | ||
const linkColor = getStyle( 'root', 'linkColor' ) ?? 'blue'; | ||
const backgroundColor = getStyle( 'root', 'backgroundColor' ) ?? 'white'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fallback values for all the properties here are the browser defaults. Note that they can defer for the actual fallback in the theme if it's using CSS to define these.
Size Change: +323 B (0%) Total Size: 1.06 MB
ℹ️ View Unchanged
|
export const StylePreview = () => { | ||
const { getStyle } = useGlobalStylesContext(); | ||
const fontFamily = getStyle( 'root', 'fontFamily' ) ?? 'serif'; | ||
const fontSize = getStyle( 'root', 'fontSize' ) ?? 'initial'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one should be set by us: in figma it's at 80px with a box of 248x152px (on an 8px grid).
Related to #34574
This implements a first iteration of the Global Styles Preview in the Global Styles sidebar.