New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@solvlab/ui

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solvlab/ui

## 应用类库

latest
npmnpm
Version
0.1.10
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

SolvUI

应用类库

  • redix-ui

    https://www.radix-ui.com/docs/primitives/overview/introduction

  • redix-ui-colors

    https://www.radix-ui.com/docs/colors/getting-started/installation

  • tailwindcss

    https://tailwindcss.com/docs/installation

  • react

开发/设计规范

目录结构

  • src

    • assets

      存放公共静态文件,eg: css | svg

    • components

      UI 组件, 组件名采用驼峰命名法(首字母大写),eg: Button

      • common>styles.tsx

        公共 tailwindcss class

    • hooks

      公共处理 hook

    • stories

      test: 生成 UI 组件 doc

    • theme

      主题文件配置

    • index.ts

      组件库入口

主题 Color 命名与使用规范

序号代表
1App backgroundApp 背景色
2Subtle background微差异 背景色
3UI element backgroundUI 元素 背景色
4Hovered UI element background悬停的 UI 元素 背景色
5Active / Selected UI element background活动/选定的 UI 元素 背景色
6Subtle borders and separators边界/分隔符 颜色
7UI element border and focus ringsUI 元素 边框色
8Hovered UI element border悬停的 UI 元素 边框色
9Solid backgrounds纯色背景
10Hovered solid backgrounds悬停的纯色背景
11Low-contrast text低对比度文本
12High-contrast text高对比度文本

Dev

  • dev | test
pnpm sb
  • build
pnpm build

Use

Install

yarn add @solvprotocol/ui

pnpm i @solvprotocol/ui

npm i @solvprotocol/ui
  • Import css
import 'solvprotocol/ui/dist/index.css'
import 'solvprotocol/ui/dist/theme/index.css'
  • Import components
import { Button } from '@solvprotocol/ui'

Custom theme

  • Use css variable
@import '@solvlab/ui/dist/index.css';
@import '@solvlab/ui/dist/theme/index.css';

/* value = hsl */
:root {
  --solv-purple3: 240, 100%, 50%;
}
/* dark theme */
.dark-theme {
  --solv-purple3: 240, 100%, 20%;
}
  • Use tailwindcss.config.js
module.exports = {
  content: ['node_modules/@solvlab/ui/dist/**/*.js'],
  theme: {
    extend: {
      colors: {
        sui: {
          theme3: 'color value',
        },
      },
      spacing: {
        // eg
        'sui-4': '14px',
      },
      fontSize: {
        // eg
        'sui-base': '14px',
      },
    },
  },
}

Keywords

solvprotocol

FAQs

Package last updated on 11 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts