Skip to content

Commit

Permalink
feat: add classnames & props helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
sungik-choi committed Dec 17, 2024
1 parent f28b742 commit e3df4e0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@use '../mixins/dimension';

$sizes: 10, 12, 16, 20, 24, 30, 36, 42, 48, 60, 72, 90, 120;

@each $size in $sizes {
:where(.size-#{$size}) {
@include dimension.square(var(--alpha-source-size-#{$size}));
}
}
10 changes: 10 additions & 0 deletions packages/bezier-react/src/types/alpha-props-helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { type SourceSize } from '~/src/types/alpha-tokens'

// NOTE: 'typescript-plugin-css-modules' does not support path alias
/* eslint-disable no-restricted-imports */
import sourceSizeStyles from '../styles/components/alpha-source-size.module.scss'
/* eslint-enable no-restricted-imports */

export function getSourceSizeClassName(size: SourceSize) {
return sourceSizeStyles[`size-${size}`]
}

0 comments on commit e3df4e0

Please sign in to comment.