GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - alineacms/styler

BranchesTags
Open more actions menu

Latest commit

 

History

14 Commits
14 Commits

Folders and files

NameName
Last commit message
Last commit date
.vscode
.vscode
 
 
src
src
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.prettierrc.json
.prettierrc.json
 
 
README.md
README.md
 
 
biome.json
biome.json
 
 
bun.lockb
bun.lockb
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

spring-easing's badge

@alinea/styler

Class name composer. Fully typed in your IDE when paired with typescript-plugin-css-modules.

// Some.module.scss
.root {
  color: blue;
  &-sub {
    color: red;
  }
}
.link {
  color: yellow;
  &.is-active {
    color: orange;
  }
  &.is-small {
    font-size: 2em;
  }
  &.is-large {
    font-size: 2em;
  }
}
import styler from '@alinea/styler'
import css from './Some.module.scss'

const styles = styler(css)

<div className={styles.root()} />
// => <div class="root_zr2ux" /> (generated class name will vary)

You can reach subclasses, separated in css by dashes, with dot access

<div className={styles.root.sub()} />
// => <div class="root-sub_zr2ux" />

Reflect state by passing objects with boolean properties or strings

<a className={styles.link({active: true})} />
// => <a class="is-active_zr2ux link_zr2ux" />

<a className={styles.link('large')} />
// => <a class="is-large_zr2ux link_zr2ux" />

<a className={styles.link({active: false}, 'small')} />
// => <a class="is-small_zr2ux link_zr2ux" />

Use styler.global to add a global classname

<div className={styles.root(styler.global('some-external-class'))} />
// => <div class="some-external-class root_zr2ux" />

Use styler.merge to add in props with a className

<div className={styles.root(styler.merge({className: 'some-external-class'}))} />
// => <div class="some-external-class root_zr2ux" />

About

No description, website, or topics provided.

Resources

Readme
Activity
Custom properties

Stars

0 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.