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

@dreamview/dreamview-theme

v1.3.4

Published

themes of dreamview

Readme

@dreamview/dreamview-theme

1、dreamview-theme是什么

dreamview-theme是dreamview主题样式变量的全集,赋予每一个变量一种语义,在开发过程中避免直接使用css样式,以达到统一管理样式的目的

2、Usage
import {Provider as ThemeProvider, makeStyles} from '@dreamview/dreamview-theme';

const useStyle = makeStyles((theme) => {
    root: {
        backgroundColor: theme.tokens.backgroundColor.main,
        color: theme.tokens.font.color.main,
    },
});

function ChildComponents() {
    const {classes} = useStyle();
    
    return (<div className={classes.root}>root</div>)
}

function App(){
    return (
        <ThemeProvider>
            <ChildComponents />
        </ThemeProvider>    
    )
}
3、自定义主题

通过替换tokens的变量的值达到替换主题的效果

import {Provider as ThemeProvider, makeStyles} from '@dreamview/dreamview-theme';

const useStyle = makeStyles((theme) => {
    root: {
        backgroundColor: theme.tokens.backgroundColor.main,
        color: theme.tokens.font.color.main,
    },
})
function ChildComponents() {
    const {classes} = useStyle();

    return (<div className={classes.root}>root</div>)
}

function App(){
    const customTheme = {
        tokens: {
            backgroundColor: {
                main: 'blue'            
            }        
        }    
    }
    return (
        <ThemeProvider config={customTheme}>
            <ChildComponents />
        </ThemeProvider>    
    )
}
4、使用components,dremview-colors中提供了一部分定义好的样式的合集,包含了组件样式和部分功能样式,正在完善中,我们称为components
import {Provider as ThemeProvider, makeStyles} from '@dreamview/dreamview-theme';

// 这里以button组件样式为例
const useStyle = makeStyles((theme) => {
    root: theme.components.button.primary,
})

function ChildComponents() {
    const {classes} = useStyle();
    
    return (<button className={classes.root}>root</button>)
}

function App(){
    return (
        <ThemeProvider>
            <ChildComponents />
        </ThemeProvider>    
    )
}
5、开发
├── README.md
├── createStyles.tsx // 创建provider和context
├── main.ts // 入口文件
├── scripts
│   └── generateType.js // 生成类型定义的脚本
├── tokens // 变量合集
│   ├── baseToken // 基础变量
│   │   ├── allColors.js // 主题色的全集
│   │   ├── colors.ts // 把每个主题色衍生出10个与之颜色相近的颜色
│   │   ├── index.ts // 基础变量
│   │   └── type.ts // 
│   └── components // components
│       ├── button.ts // button组件的样式
│       └── index.ts
  • 增加主题色
    1. 在allColors.js中增加主题色
    2. 运行命令生成类型文件yarn lerna run generate:types --scope=@dreamview/dreamview-theme
  • 修改/增加/删除基础变量
    1. 修改tokens/baseToke/index.ts文件即可
  • 增加一组样式的合集
    1. 在tokens/components下创建文件夹编写自己的样式合集
    2. 在tokens/components/index.ts中导出你创建的文件