예제
실용적인 예제와 라이브 데모.
예제를 선택하면 라이브 미리보기와 소스 코드를 나란히 표시하는 전체 화면이 열립니다.
예제를 선택하면 라이브 미리보기와 소스 코드를 나란히 표시하는 전체 화면이 열립니다.
타입이 지정된 스타일 객체 하나로 클래스를 만듭니다.
One style object returns one reusable class.
import 'nuclo' // A theme: named colors (and screens) that css() accepts as values const { css, cx } = createCss({ colors: { primary: "#ff3f00", surface: "#fafafa", border: "#d4d4d4", text: "#222222", muted: "#737373", }, screens: { sm: "(min-width: 520px)", }, }) // css() turns one style object into one reusable class const card = css({ p: 16, rounded: 8, border: "1px solid", borderColor: "border", bg: "surface", color: "text", w: "100%", maxW: 260, }) const quiet = css({ color: "muted", text: 13, lineHeight: "1.5", marginTop: 6 }) // A class is just an argument: pass it to the element export function Card() { return div( card, strong("Simple card"), p(quiet, "One style object returns one reusable class."), ) }