marvin1023 / sasscore Goto Github PK
View Code? Open in Web Editor NEW一份基础的scss库,包括常用reset, mixin, grids, typo, css3, media queries等多个文件,是你sass开发的必备库
Home Page: http://w3cplus.com/sasscore/index.html
一份基础的scss库,包括常用reset, mixin, grids, typo, css3, media queries等多个文件,是你sass开发的必备库
Home Page: http://w3cplus.com/sasscore/index.html
Suggest to add basic layout example so it can quickly get user started
core/_grid.scss
106行:
@if $i < $gridColumns { @extend %float-left; }
%float-left
好像没有定义?
调用_css3.scss中的transition:
// Return vendor-prefixed property names if appropriate
// Example: transition-property-names((transform, color, background), moz) -> -moz-transform, color, background
//----------------------------------------
@function transition-property-names($props, $vendor: false) {
$new-props: ();
@each $prop in $props {
$new-props: append($new-props, transition-property-name($prop, $vendor), comma);
}
@return $new-props;
}
@function transition-property-name($prop, $vendor: false) {
// put other properties that need to be prefixed here aswell
@if $vendor and $prop == transform {
@return unquote('-'+$vendor+'-'+$prop);
}
@else {
@return $prop;
}
}
// transition
//----------------------------------------
@mixin transition ($properties...) {
@if length($properties) >= 1 {
@include prefixer(transition, $properties, webkit moz o ms spec);
}
@else {
$properties: all 0.15s ease-out 0;
@include prefixer(transition, $properties, webkit moz o ms spec);
}
}
实际引用:
li {
@include transition(transform .2s ease );
}
编译出来的css:
li{
-webkit-transition: transform 0.2s ease;
-moz-transition: transform 0.2s ease;
-o-transition: transform 0.2s ease;
-ms-transition: transform 0.2s ease;
transition: transform 0.2s ease;
}
我需要的是:
li{
-webkit-transition: -webkit-transform 0.2s ease;
-moz-transition:-moz-transform 0.2s ease;
-o-transition: -o-transform 0.2s ease;
-ms-transition: -ms-transform 0.2s ease;
transition: transform 0.2s ease;
}
有何办法可以解决
借鉴别人的代码感觉有些多
// inline-block
// ie6-7 _display: inline;_zoom:1;
@mixin inline-block ($extend:true) {
@if $extend {
@extend %inline-block;
} @else {
display: inline-block;
@if $lte7 {
_display: inline;_zoom:1;
}
}
}
%inline-block{
@include inline-block(false);
}
以上说库中对 inline-block的定义,理解了一下,感觉在自己绕圈子呢?以下是为我的分析:
分几种情况:
一:调用 @include inline-block,执行 @mixin里的条件true,再执行 %inline-block,再执行 @mixin 里的条件false,最终是执行 @mixin里的条件 false;
二:跳用 @include inline-block(false),直接调用 @mixin里的条件 false;
三:调用 %inline-block,直接调用 @mixin里的条件 false;
以上就是所有的调用方式,但是最终都是调用 @mixin里的条件 false;
不知道还有其他调用方式吗?
如你介绍一样,@mixin 和 % 在sass解析成css的时候不一样,但是在用gulp等自动化工具将css合并压缩css为一行的时候,也会自动组合css样式的,那么这个问题是否可以忽略呢?
@import "../bower_components/sassCore/base";
.container{
@include center-block;
width:getWidth();
min-width: getWidth();
}
上面代码,会如下输出
.container {
margin-left: auto;
margin-right: auto; }
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
* 0. sassCore's style
*/
html {
font-family: sans-serif;
/* 1 */
-ms-text-size-adjust: 100%;
/* 2 */
-webkit-text-size-adjust: 100%;
/* 2 */
overflow-y: scroll;
/* 0 */
-webkit-overflow-scrolling: touch;
/* 0 */ }
这个和文档不一致,会直接输出在reset部分的前面,我要去看源码才能找出问题所在
.WARNING: Unrecognized prefix: moz
D:/www/github/sassCore/core/css3:41, in mixin prefixer
D:/www/github/sassCore/core/css3:103, in mixin box-sizing
D:/www/github/sassCore/core/mixin:275
ING: Unrecognized prefix: moz
D:/www/github/sassCore/core/css3:41, in mixin prefixer
D:/www/github/sassCore/core/css3:208, in mixin transition
D:/www/github/sassCore/core/mixin:322
ING: Unrecognized prefix: o
D:/www/github/sassCore/core/css3:41, in mixin prefixer
D:/www/github/sassCore/core/css3:208, in mixin transition
D:/www/github/sassCore/core/mixin:322
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.