1.0.0 • Published 7 years ago

dreamui-sass v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

tools_sass: common mixin、selector's lib

Features

Zero Pollution

This lib use sass mixin and placeholder-selector to ensure your project code is pure. And We don't generate any unuseful css code.

Perfect Compatibility

This lib is compatible with lower version of the browsers, such as flex、transform、animation and other css attributes.

Develop Mode

$ yarn install
$ yarn test:watch
$ yarn test:liveload

Install

  • NPM
npm add tools_sass
# or
yarn add tools_sass
  • GIT-Submodule (Recommend)
$ mkdir public_modules
$ git submodule add https://github.com/borenXue/tools_sass.git public_modules/tools_sass

/** ~ Optional ~
 * Add npm-script for auto install this lib.
 * Modify script field of package.json file to add preinstall-script.
 */
 "script": {
    "preinstall": "git submodule init; git submodule update;",
 }
  • GIT-Subtree
git remote add tools_sass https://github.com/borenXue/tools_sass.git
$ git subtree add --prefix=public_modules/tools_sass tools_sass master
$ git subtree pull --prefix=public_modules/tools_sass tools_sass master

Usage

@import 'public_modules/tools_sass/index.scss'

/**
 *  scss syntax examples
 */
.fill-parent {            // placeholder-selector example
  @extend %fill-parent;
}

.fill-parent {            // mixin example
  @include display-flex;
}

/**
 *  sass syntax examples
 */
.fill-parent            // placeholder-selector example
  @extend %fill-parent

.fill-parent            // mixin example
  +display-flex

Function List

FunctionDesc
px2remeg: px2rem(100px)
rem2pxeg: px2rem(10rem)

Placeholer List

PlaceholerDesc
fill-parent----
fill-width----
fill-height----
max-fill-parent----
single-line-ellipsis----
flex-center----
flex-center-inline----
flex-left----
flex-space-between----
flex-h----
flex-v----
text-force-break----
model-fixed-full----
vcenter----
model-absolute-full----
uppercase----
border-box----

Mixin List

ModuleSubModuleMixin NameDemo
Border-Box
--box-sizingbox-sizing()
--squaresquare(200px)
--circlecircle(200px)
--box-shadowbox-shadow(0 0 3px #525252)
border-radiusborder-radiusborder-radius(8px)
border-top-right-radiusborder-top-right-radius(8px)
border-top-left-radiusborder-top-left-radius(8px)
border-bottom-right-radiusborder-bottom-right-radius(8px)
border-bottom-left-radiusborder-bottom-left-radius(8px)
border-top-radiusborder-top-radius(8px)
border-bottom-radiusborder-bottom-radius(8px)
border-left-radiusborder-left-radius(8px)
border-right-radiusborder-right-radius(8px)
thin-borderthin-borderthin-border(red, 'all', initial, after)
thin-border-allthin-border-all(red)
thin-border-topthin-border-top(red)
thin-border-bottomthin-border-bottom(red)
thin-border-leftthin-border-left(red)
thin-border-rightthin-border-right(red)
Text
--text-force-breaktext-force-break()
--single-line-ellipsissingle-line-ellipsis()
--multi-line-ellipsismulti-line-ellipsis(3)
--placeholderplaceholder { ... }
Flex
--display-flexdisplay-flex()
--display-inline-flexdisplay-inline-flex()
--display-flex-importantdisplay-flex-important()
--flex-directionflex-direction(3)
--flex-wrapflex-wrap(nowrap)
--flexflex(1)
--flex-flowflex-flow(nowrap)
--align-itemsalign-items(stretch)
--align-selfalign-self(auto)
--align-contentalign-content(stretch)
--justify-contentjustify-content(stretch)
--flex-orderflex-order(3)
--responsive-grid-breakresponsive-grid-break(.a-cls, 800px)
Transition
coretransitiontransition(height 300ms ease-in)
--transition-delaytransition-delay(300ms)
--transition-durationtransition-duration(300ms)
--transition-timing-functiontransition-timing-function(ease-in)
--transition-propertytransition-property(height)
--transition-transformtransition-transform(height, width)
Transform
coretransformtransform(scaleY(.5))
coretransform-origintransform-origin(0, 0)
--scalescale(1, .5)
--scaleYscaleY(.5)
--scaleXscaleX(1)
--rotaterotate(45deg)
--translatetranslate(6px, 2px)
--translateXtranslateX(6px)
--translateYtranslateY(2px)
--translate3dtranslate3d(6px, 2px, 5px)
--translateXtranslateX(5px)
--skewskew(1px, 2px)
Animation
--animationanimation(3s linear 1s slidein)
--animation-durationanimation-duration(3s)
--animation-directionanimation-direction(alternate-reverse)
--animation-timing-functionanimation-timing-function(ease-in)
--animation-fill-modeanimation-fill-mode(both)
--animation-nameanimation-name(test-name)
--animation-iteration-countanimation-iteration-count(3)
UI
--xui-rowxui-row(): .xui-row、.xui-col-0 ~ .xui-col-100
--xui-progressingxui-progressing(): .xui-progressing-0 ~ .xui-progressing-100
Others
--appearanceappearance(none)
--user-selectuser-select(none)
--linear-gradientlinear-gradient(to left top, blue, red)
--keyframeskeyframes(base-animation) {...}

Changelog

Details changes for each release are documented in the release notes.

LICENCE

MIT

Copyright (c) 2017-present, Boren.Xue xueboren001@outlook.com