npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vvi/style

v1.0.0

Published

样式

Downloads

47

Readme

style

version issues 提交

提供一个简单样式集(虽然叫样式集,但是是用于 HTML 节点元素的样式类名)。

安装

npm install --save @vvi/style

# pnpm
pnpm add --save @vvi/style

# yarn
yarn add --save @vvi/style

使用

并不会自动注入 css 或 scss 样式,需要手动引入

import { style } from "@vvi/style";

export const Home = () => {

    return <div className={style('center', 'text-center')}>你好</div>
}

当然,简单的使用仅是为元素添加样式,若想让其样式生效,还需要手动引入对应样式:

// 方式一:直接引入 css
import "@vvi/style/common.css";

// 方式二:使用 scss
import "@vvi/style/common.scss";

// 方式三:使用构建方法
import { ensureGlobalStyles } from '@vvi/style';

// 该方法不建议直接在 SSR/SSG 环境下直接使用
ensureGlobalStyles(); 

但是,直接在 "ts" 或 "tsx" 文件中引入 ".css" 或 ".scss" 文件在部分使用场景下无法被正确的引入到项目。可以通过项目内使用新建项目级 ".css" 或 ".scss" 文件,然后在该文件中引入样式。

// 引入项目级的文件 
import "./common.css";
// common.css 文件
import "@vvi/style/common.css";

// 或使用 
import "./common.scss";
// common.scss 文件
@use '@vvi/style/common.scss';

状态

此软件包是 MrMudBean 生态系统的一部分。 它使用严格的 TypeScript 编写,并通过 Rollup 构建进行验证。 虽然单元测试较少,但 API 稳定,并在生产环境中大量使用。