1.0.9 • Published 1 year ago

plus.resetcss v1.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

常用css样式库

##以下为在uniapp中的使用方法,其它项目大同小异

安装

npm install plus.resetcss
// 或
yarn add plus.resetcss

使用

在App.vue项目入口文件引入

// App.vue
<style lang="scss">
    ...其它css文件
    @import "@/styles/index.scss";
</style>

非uniapp项目中可打开 plus.resetcss.rpx.min.css 复制到您的文件中以标签方式引入使用

<link rel="stylesheet" href="plus.resetcss.rpx.min.css">

说明

reset 初始化默认样式

这里只做了简单的初始化样式

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
}
a:hover {
    opacity: .9;
}

flex 弹性布局

class描述
-flex变为弹性盒子
-inline-flex变为行内弹性盒子
-flex-col垂直的弹性盒子
-flex-col-reverseflex-direction: column-reverse
-flex-row垂直的弹性盒子
-flex-row-reverseflex-direction: row-reverse
-flex-center垂直水平居中
-flex-wrap让弹性盒元素在必要的时候拆行
-flex-nowrap不拆行或不拆列
-flex-wrap-reverseflex-wrap: wrap-reverse
-flex-1flex: 1 1 0%;
-flex-autoflex: 1 1 auto;
-flex-initialflex: 0 1 auto;
-flex-noneflex: none;
-flex-growflex-grow: 1;
-flex-grow-0flex-grow: 0;
-flex-y-startjustify-content: flex-start;
-flex-y-endjustify-content: flex-end;
-flex-y-centerjustify-content: center;
-flex-y-betweenjustify-content: space-between;
-flex-y-aroundjustify-content: space-around;
-flex-y-evenlyjustify-content: space-evenly;
-flex-x-startalign-items: flex-start;
-flex-x-endalign-items: flex-end;
-flex-x-centeralign-items: center;
-flex-x-baselinealign-items: baseline;
-flex-x-stretchalign-items: stretch;
-flex-xy-center垂直水平居中

width 宽度

class描述
-w-0width: 0;
-w-autowidth: auto;
-w-1_2width: 50%;
-w-1_3width: 33.333%;
-w-1_4width: 25%;
-w-1_4width: 25%;
-w-1_5width: 20%;
-w-fullwidth: 100%;
-w-screenwidth: 100vw;
-w-minwidth: min-content;
-w-maxwidth: max-content;
-min-w-0min-width: 0px;
-min-w-fullmin-width: 100%;
-min-w-screenmin-width: 100vw;
-min-w-minmin-width: min-content;
-min-w-maxmin-width: max-content;
-max-w-0max-width: 0;
-max-w-nonemax-width: none;
-max-w-fullmax-width: 100%;
-max-w-screenmax-width: 100vw;

height 高度

class描述
-h-0height: 0;
-h-autoheight: auto;
-h-1_2height: 50%;
-h-1_3height: 33.333%;
-h-1_4height: 25%;
-h-1_4height: 25%;
-h-1_5height: 20%;
-h-fullheight: 100%;
-h-screenheight: 100vw;
-h-minheight: min-content;
-h-maxheight: max-content;
-min-h-0min-height: 0px;
-min-h-fullmin-height: 100%;
-min-h-screenmin-height: 100vw;
-min-h-minmin-height: min-content;
-min-h-maxmin-height: max-content;
-max-h-0max-height: 0;
-max-h-nonemax-height: none;
-max-h-fullmax-height: 100%;
-max-h-screenmax-height: 100vw;

text 文字处理

class描述
-font-bold字体加粗
-font-normal默认,标准的字体
-text-left文本左对齐
-text-center文本居中
-text-right文本右对齐
-text-justify两边对齐
-line-through定义穿过文本下的一条线
-underline定义文本下的一条线
-no-underline默认。定义标准的文本
-line-[1-5]文字溢出显示省略号,范围从1到5,列:-line-2,超过两行其余的隐藏并显示省略号

space 内边距和外边距的简写

class描述
-m-[0-80]0-80范围四条边的外边距,-m同等与margin属性,列:-m-10等于margin: 10rpx
-mx-[0-80]0-80左右两边的外边距,-mx同等与margin-left跟margin-right属性,列:-mx-10等于margin-left: 10rpx, margin-right:10rpx
-py-[0-80]0-80上下两边的外边距,-my同等与margin-top跟margin-bottom属性,列:-my-10等于margin-top: 10rpx, margin-bottom:10rpx
-m[l\/t\/r\/b]-[0-80]单边的外边距,l/t/r/b是left,top,right,bottom的简写,列:-ml-10等于margin-left: 10rpx
-m[l\/t\/r\/b]-auto单边的外边距,l/t/r/b是left,top,right,bottom的简写,列:-ml-auto等于margin-left: auto
-p-[0-80]0-80范围四条边的内边距,-p同等与padding属性,列:-p-10等于padding: 10rpx
-px-[0-80]0-80左右两边的内边距,-px同等与padding-left跟padding-right属性,列:-px-10等于padding-left: 10rpx, padding-right:10rpx
-py-[0-80]0-80上下两边的内边距,-py同等与padding-top跟padding-bottom属性,列:-my-10等于padding-top: 10rpx, padding-bottom:10rpx
-p[l\/t\/r\/b]-[0-80]单边的内边距,l/t/r/b是left,top,right,bottom的简写,列:-pl-10等于padding-left: 10rpx
1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago