File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 11'use client' ;
22import React from 'react' ;
33import { clsx } from 'clsx' ;
4+ import { customClassSwitcher } from '~/core' ;
5+
6+ const COMPONENT_NAME = 'Code' ;
7+
48export type CodeProps = {
59 children : React . ReactNode ;
10+ customRootClass ?: string ;
611}
712
8- const Code = ( { children } : CodeProps ) => {
9- return < code className = { clsx ( 'rui-code-root' ) } >
13+ const Code = ( { children, customRootClass= '' } : CodeProps ) => {
14+ const rootClass = customClassSwitcher ( customRootClass , COMPONENT_NAME )
15+
16+ return < code className = { clsx ( rootClass ) } >
1017 { children }
1118 </ code > ;
1219} ;
Original file line number Diff line number Diff line change 1- .rui-code-root {
1+ .rad-ui-code {
22 color : var (--rad-ui-color-accent-950 );
33 background-color : var (--rad-ui-color-accent-400 );
44 padding : 1px 10px ; // Add space for readability
You can’t perform that action at this time.
0 commit comments