Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ctx-core/html
https://github.com/ctx-core/html
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ctx-core/html
- Owner: ctx-core
- License: other
- Created: 2019-12-02T17:15:59.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-23T07:44:46.000Z (7 months ago)
- Last Synced: 2024-05-23T08:50:14.100Z (7 months ago)
- Language: JavaScript
- Size: 360 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: License.md
Awesome Lists containing this project
README
# @ctx-core/html
Utility html functions.
## class_
class_ has the same functionality as [clsx](https://github.com/lukeed/clsx/) yet is 94 B, or < 50% the size of clsx. It's also a good way to break up tailwind class usage...which is useful for reordering classes into logical groups.
This example uses relementjs, but any UI library can be used.
```tsx
import { class_ } from '@ctx-core/html'
import { div_ } from 'relementjs/html'
div_({
class: class_(
['foo', ['bar'], 0 && ['will-not-render']],
{ 'font-bold': is_bold },
'text-white',
'bg-black')
}, 'Hello!')
```This library is implemented in [ctx-core](https://github.com/ctx-core/ctx-core) which has 0 dependencies & has a wide breadth of modules. Importing `class_` in the above example would look like:
```ts
import { class_ } from 'ctx-core/html'
```More docs to come.