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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@itshixun/qst-ui-system

v0.2.5

Published

qst ui system

Downloads

24

Readme

qst-ui-system

QST 前端 UI 基础库:

  1. 对接设计端定制的颜色/间距/风格(圆角/边框)等主题规范,作为 UI 设计和前端开发之间的“接口”;
  2. 将设计端定制的主题规范 关联到常用组件库的主题配置上;
  3. 将设计端定制的主题规范 关联到常用 css 框架的配置上;
  4. 通用的 normalize(reset)样式和其他全局样式;

主要功能

  • [x] 基于 element-plus 的 css 变量,生成主题变量配置:颜色/字色/背景色/圆角/间距/组件尺寸 等等,
  • [x] 全局初始化样式:normalize,全局文字配置(字体/抗锯齿等)
  • [ ] 组件库适配主题变量配置(样式覆盖)
    • [x] element-plus
    • [ ] element-ui
    • [ ] ant-design / ant-design-vue
    • [ ] vant
  • [ ] css 框架适配主题变量配置
    • [x] unocss
    • [ ] windicss (windicss即将停止维护,不再进行适配)
    • [ ] tailwind

对接&使用说明

设计端:

  1. 设计师使用主题编辑器配置并导出 json 格式的主题列表
  2. 在 UI 设计的过程中遵循配置好的主题进行设计

前端:

  1. 在项目入口(main.js/main.ts)调用initQstTheme()初始化主题样式,引入设计端定制好的主题(不传则使用默认主题列表)

    import { initQstTheme } from 'qst-ui-system';
    // 初始化qst主题,不传参数使用默认配置
    initQstTheme();
    
    // 类型定义
    export declare const initQstTheme: (option?: ThemeOption) => void;
    
    /** 主题选项 */
    export interface ThemeOption {
      /** 主题css变量命名空间 默认--el */
      namespace?: string;
      /** 主题列表 */
      themeList?: UITheme[];
      /** 主题样式设置完成后的回调函数 */
      onStylesSet?: () => void;
      /** 是否包含css重置样式(reset/normalize) 默认是 */
      cssReset?: boolean;
      /** 需要适配的组件库(进行样式覆盖/主题定制)  */
      uiLibs?: UILib | UILib[];
      /** 初始主题序号, 默认为主题列表中第一个主题 */
      initialThemeIndex?: number;
    }
  2. 如果使用 element-plus 组件库,则 element 组件自动适配引入的主题配置;其他组件库需要额外的步骤(WIP)

  3. 使用 css 框架(比如 unocss),可以方便的调用主题配置进行样式编写(需要在相应的配置文件中引入主题配置 WIP)

    import { generateUnocssTheme } from 'qst-ui-system';
    // unocss配置
    {
      ...
      presets: [...],
      safelist: [...],
      transformers: [...]
      // 生成主题配置 参数为namespace,默认'--el'
      theme: generateUnocssTheme('--el'),
      ...
    }