Skip to content
This repository has been archived by the owner on Mar 22, 2020. It is now read-only.

Commit

Permalink
fix: #20 Multiline problem with few text
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikiki committed May 12, 2018
1 parent 457e6a4 commit eb00d1b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 29 deletions.
50 changes: 23 additions & 27 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ var postcss = require('gulp-postcss');
var rollup = require('gulp-better-rollup');
var runSequence = require('run-sequence');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var spawn = require('child_process').spawn;
var minify = require('gulp-babel-minify');

Expand Down Expand Up @@ -49,17 +48,19 @@ var distJsFile = package.name + '.min.js';

// Uses Sass compiler to process styles, adds vendor prefixes, minifies, then
// outputs file to the appropriate location.
gulp.task('build:styles', ['build:styles:copy'], function() {
return gulp.src([paths.bulma + bulmaSassFile, paths.src + mainSassFile])
.pipe(concat(globalSassFile))
.pipe(sass({
style: 'compressed',
includePaths: [paths.bulma]
}))
.pipe(concat(distCssFile))
.pipe(postcss([autoprefixer({browsers: ['last 2 versions']})]))
.pipe(cleancss())
.pipe(gulp.dest(paths.dest));
gulp.task('build:styles', function() {
runSequence('build:styles:copy',function() {
return gulp.src([paths.bulma + bulmaSassFile, paths.src + mainSassFile])
.pipe(concat(globalSassFile))
.pipe(sass({
style: 'compressed',
includePaths: [paths.bulma]
}))
.pipe(postcss([autoprefixer({browsers: ['last 2 versions']})]))
.pipe(cleancss())
.pipe(concat(distCssFile))
.pipe(gulp.dest(paths.dest));
});
});

// Copy original sass file to dist
Expand All @@ -69,12 +70,11 @@ var distJsFile = package.name + '.min.js';
.pipe(gulp.dest(paths.dest));
});

gulp.task('clean:styles', function(callback) {
gulp.task('clean:styles', function() {
del([
paths.dest + mainSassFile,
paths.dest + distCssFile
]);
callback();
});

/**
Expand All @@ -87,51 +87,47 @@ gulp.task('clean:styles', function(callback) {
// appropriate location.
gulp.task('build:scripts', function() {
return gulp
.src([paths.src + paths.jsPattern])
.pipe(sourcemaps.init({
loadMaps: true
}))
.src([paths.src + mainJsFile])
.pipe(rollup({
plugins: [babel({
babelrc: false,
sourceMaps: true,
sourceMaps: false,
exclude: 'node_modules/**',
presets: [
["@babel/preset-env", {
"modules": false,
"targets": {
"browsers": gutil.env.babelTarget ? gutil.env.babelTarget : ["last 2 versions"]
"browsers": gutil.env.babelTarget ? gutil.env.babelTarget : ['last 2 versions']
}
}]
]
})]
}, {
format: gutil.env.jsFormat ? gutil.env.jsFormat : 'iife',
format: 'umd',
name: camelCase(package.name)
}
))
).on('error', function(err) {
gutil.log(gutil.colors.red('[Error]'), err.toString())
}))
.pipe(concat(globalJsFile))
.pipe(gulp.dest(paths.dest))
.pipe(concat(distJsFile))
.pipe(minify().on('error', function(err) {
gutil.log(gutil.colors.red('[Error]'), err.toString())
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest(paths.dest));
});

gulp.task('clean:scripts', function(callback) {
gulp.task('clean:scripts', function() {
del([
paths.dest + mainJsFile,
paths.dest + distJsFile
]);
callback();
});

// Deletes the entire dist directory.
gulp.task('clean', ['clean:scripts', 'clean:styles'], function(callback) {
gulp.task('clean', function() {
del(paths.dest);
callback();
});

/**
Expand Down
4 changes: 2 additions & 2 deletions src/extension.sass
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ $tooltip-max-width: 24rem !default

&.is-tooltip-multiline
&::before
min-width: $tooltip-max-width
//min-width: $tooltip-max-width
text-overflow: clip
white-space: normal
word-break: break-word
word-break: keep-all

@each $name, $pair in $colors
$color: nth($pair, 1)
Expand Down

0 comments on commit eb00d1b

Please sign in to comment.