Giter Club home page Giter Club logo

webbasecss's Introduction

关于项目

  • 适用场景:使用了UI组件库(如ant-design,element,iview等)的web系统
  • 功能:提供统一易用的基础样式类库,以减少在项目开发中编写冗余css,并实现UI界面的整体一致性
  • 不同于其他css库,本项目遵从最小颗粒样式原则,你可以自由组合类名以达到复合样式展现的目的
  • 项目内部引入normalize.css库,以解决现代html元素在各个浏览器端表现不一的问题

类名的命名规则:

总原则:面向属性命名、对开发者透明且有表现意义、所有字母均小写,单个中划线作为辅助

分类 规则 示例
属性值为数字类型的类名命名规则 数值与属性之间不加中划线 m10 —> margin: 10px
mr10 —> margin-right: 10px
pt40 -> padding-top: 40px
w80 -> width: 80px
属性值为非数字类型的类名命名规则 属性名首字母缩写-属性值单词首字母缩写 dis-ib -> display: inline-block
ta-c -> text-align: center
td-ol -> text-decoration: overline
首字母简写有歧义的属性命名 采用属性名单词缩写形式命名 dis-ib -> display: inline-block

使用介绍

  1. npm i web-base-css
  2. 全局引入webBaseCSS: import 'web-base-css/dist/index.css';
  3. 在需要设置样式的标签上定义类,如 <div class="mt10 w200"></div> 表示对div设置margin-top: 10px; width: 200px
  4. normalize.css

webbasecss's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.