code-hike-classer-vue3

A little package to make Vue3 component libraries interoperable with most styling solutions.
1,553
Install
npm install code-hike-classer-vue3
Latest Version:0.1.7
Vue:3
License:MIT
Last Updated:Aug 9, 2023
Links: GitHub  ·  npm
Maintainer: wc57242263

A little package to make React component libraries interoperable with most styling solutions.

online demo

https://stackblitz.com/edit/vitejs-vite-oqvfsr

install

npm i

# with usage demo
npm run dev

classer + emotion usage

full demo:

npm run dev

  • Provider
<script setup lang="ts">
import { css } from '@emotion/css';
import { ClasserProvider } from 'code-hike-classer-vue3';
import Child from './components/Child.vue';

const color = 'white';
const motion = css`
  background-color: hotpink;
  &:hover {
    color: ${color};
  }
`;
</script>

<template>
  <classer-provider
    :classes="{
      'sp-title': 'title-1 title-2',
      'sp-motion': motion,
    }"
  >
    <child />
  </classer-provider>
</template>
  • Child
<template>
  <button :class="[c('title', 'motion', 'other')]">i am child</button>
</template>

<script setup lang="ts">
import { useClasser } from 'code-hike-classer-vue3';

const c = useClasser('sp', { 'sp-other': 'custom-class' });
</script>

  • result
<div class="sp-title sp-motion sp-other title-1 title-2 css-64o2cv custom-class">i am child</div>

css-64o2cv is motion style

sipport browsers

npx browserslist

Related Packages

markdown-to-jsx

A very fast and versatile markdown toolchain. AST, React, React Native, SolidJS,...

214,042,213 2,394
@scalar/use-toasts

display toasts in Vue

24,371,992 16,329
@scalar/use-codemirror

CodeMirror for Vue

21,770,238 16,329
@scalar/api-reference

Generate beautiful API references from OpenAPI documents

21,031,808 16,329
vaul-vue

Vaul Vue is an unstyled drawer component for Vue that can be used as a Dialog re...

19,162,483 497

Version History

Version Released Vue License
0.1.7 ^3.2.0 MIT
0.1.6 ^3.2.0 MIT
0.1.5 ^3.2.33 MIT
0.1.4 ^3.2.33 MIT
0.1.3 ^3.2.33 MIT