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 🙏

© 2025 – Pkg Stats / Ryan Hefner

jk-comps

v0.1.1-dev

Published

## Installation

Downloads

31

Readme

jk-comps

Installation

npm i --save jk-comps
// main.js
import jkComps from 'jk-comps'
import 'jk-comps/lib/ele-var.scss' // 覆盖element主题色, 引入此行, 则不需再次引入element样式

Vue.use(jkComps)
jkComps.themeUtil.initTheme()
// vue.config.js
module.exports = {
  css: {
    loaderOptions: {
      scss: {
        prependData: `@import "jk-comps/lib/theme.scss";`
      }
    }
  }
}

Usage

主题工具

jkComps会给Vue.prototype绑定一个$themeUtils

// 使用方式
// 初始化主题
$themeUtils.initTheme()

// 切换主题(如果不传参, 则默认切换当前主题)
$themeUtils.setTheme() // dark -> light || light -> dark
$themeUtils.setTheme('dark') // 切换至dark 主题
$themeUtils.setTheme('light') // 切换至light主题

$themeUtils.getTheme() // 获取当前主题 [dark|light]

记忆主题

// 设置`useMemory`为true, 则会把主题存在localStorage中
$themeUtils.initTheme({ useMemory: true })

样式工具

jk-comps 提供了一些scss mixin, 可通过@include方式调用, 可用列表如下

  • color 文字颜色
  • bgcolor 背景色
  • bdcolor 边框颜色
    • bdcolor-top
    • bdcolor-right
    • bdcolor-bottom
    • bdcolor-left
  • outline-color outline颜色

使用示例

// 此处设置了div元素的背景色
// 在黑色主题下, 背景色为#ccc
// 在白色主题下, 背景色为#333
div {
  @include bgcolor(#ccc, #333);
  @include bdcolor-top(#ddd, #222);
}

Element 说明

所有.jk-style class的元素及子元素, 都会自动继承此库设置的样式

样式覆盖列表

  • [x] Button
  • [x] Radio
  • [ ] Checkbox
  • [ ] Input
  • [ ] Select
  • [ ] TimePicker
  • [ ] DatePicker
  • [ ] Transfer
  • [x] Table
  • [x] Breadcrumb
  • [x] Dialog
  • [x] Drawer
  • ...more

其他

  • [x] 滚动条样式(chrome)

button

button有多种颜色类型, 用class区分

  • blue
  • lightblue
  • green
  • red
  • orange
  • gray

使用方式如下

<el-button class="blue">btn</el-button>