Permalink
Browse files

fixes some errors in Sass convert task

  • Loading branch information...
1 parent e26361d commit 23093cfac647fe4a1a7c2b7bc4fa49a222a9277f Minwe committed May 25, 2016
Showing with 64 additions and 11 deletions.
  1. +9 −0 tools/tasks/sass/_functions.scss
  2. +17 −9 tools/tasks/sass/index.js
  3. +38 −2 tools/tasks/sass/scss/table.scss
@@ -0,0 +1,9 @@
+// Strip Unit
+// Removes the unit (e.g. px, em, rem) from a value, returning the number only.
+//
+// @param {number} $num - Number to strip unit from.
+//
+// @return The same number, sans unit.
+@function strip-unit($num) {
+ @return $num / ($num * 0 + 1);
+}
@@ -1,7 +1,5 @@
'use strict';
-/* jshint node: true */
-
var exec = require('child_process').exec;
var path = require('path');
var format = require('util').format;
@@ -17,8 +15,8 @@ var paths = {
sassRepo: '../amazeui-sass'
};
-gulp.task('sass:clean', function(callback) {
- del(sassPath, callback);
+gulp.task('sass:clean', function() {
+ return del(sassPath);
});
gulp.task('sass:copy:less', function() {
@@ -44,7 +42,7 @@ gulp.task('sass:convert', function() {
paths.scss + '/*.scss',
paths.widget + '/*/src/*.scss'
])
- // change less/ dir to scss/ on imports
+ // change less/ dir to scss/ on imports
.pipe(replace(/\/less\//g, '/scss/'))
// gradient filter
.pipe(replace(/filter:\s*e\(\%\("progid:DXImageTransform\.Microsoft\.gradient\(startColorstr='\%d',\s*endColorstr='\%d',\s*GradientType=(\d)\)",\s*argb\((@.+)*\),\s*argb\((@.*)\)\)\)/g, function(all, $1, $2, $3) {
@@ -67,6 +65,10 @@ gulp.task('sass:convert', function() {
function(match, $1, $2) {
return format('@include %s(%s);', $1, $2.replace(/;/g, ','));
}))
+ // button-variant mixin
+ .pipe(replace('a&:visited {', '$selector: &;\na#{$selector}:visited {'))
+ // thumbnail.less
+ .pipe(replace('img&,', '$selector: &;\nimg#{$selector},'))
// button.less
.pipe(replace(/\.(button-\w+)\((.*)\);/g,
function(match, $1, $2) {
@@ -90,6 +92,11 @@ gulp.task('sass:convert', function() {
.pipe(replace(/\.square\((.*)\);/g, '@include square($1);'))
// .border-*-radius();
.pipe(replace(/\.(border-\w+-radius)\((.*)\)/g, '@include $1($2)'))
+ // animation.less
+ .pipe(replace(/\.(variant-animation-delay)\((.*)\);/g,
+ function(match, $1, $2) {
+ return format('@include %s(%s);', $1, $2.replace(/;/g, ','));
+ }))
// comment.less
.pipe(replace(/\.(comment-highlight-variant)\((.*)\);/g,
function(match, $1, $2) {
@@ -206,10 +213,11 @@ gulp.task('sass:deploy:misc', function() {
});
gulp.task('sass:test', function(callback) {
- exec('sass ../amazeui-sass/scss/amazeui.scss', function(err, stdout, stderr) {
- // console.log(stdout);
- console.log(stderr);
- });
+ exec('node-sass ../amazeui-sass/scss/amazeui.scss',
+ function(err, stdout, stderr) {
+ // console.log(stdout);
+ console.log(stderr);
+ });
callback();
});
@@ -147,6 +147,7 @@ th {
/* Bordered version */
.#{$ns}table-bordered {
border: 1px solid $table-border-color;
+ border-left: none;
// @include hook-table-bordered();
> thead,
@@ -157,9 +158,10 @@ th {
> td {
border-left: 1px solid $table-border-color;
- &:first-child {
+ // 避免有 rowspan 的时候后面的行没有左边框
+ /*&:first-child {
border-left: none;
- }
+ }*/
}
}
}
@@ -245,6 +247,40 @@ th {
}
+// Modifiers: compact
+// =============================================================================
+
+.#{$ns}table-compact {
+ > thead,
+ > tbody,
+ > tfoot {
+ > tr {
+ > th,
+ > td {
+ padding: $table-cell-padding-compact;
+ }
+ }
+ }
+}
+
+
+// Modifiers: centered
+// =============================================================================
+
+.#{$ns}table-centered {
+ > thead,
+ > tbody,
+ > tfoot {
+ > tr {
+ > th,
+ > td {
+ text-align: center;
+ }
+ }
+ }
+}
+
+
// Modifiers: states
// =============================================================================

0 comments on commit 23093cf

Please sign in to comment.