Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP SCSS conversion #261

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
*.patch
.DS_Store
.project
.settings
.settings
.sass-cache
37 changes: 36 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function(grunt) {
pkg: pkginfo,

meta: {
banner: "/*! <%= pkg.title %> <%= pkg.version %> | <%= pkg.homepage %> | (c) 2014 YOOtheme | MIT License */"
banner: "/*! <%= pkg.title %> <%= pkg.version %> | <%= pkg.homepage %> | (c) 2014 YOOtheme | MIT License */"
},

jshint: {
Expand Down Expand Up @@ -131,6 +131,39 @@ module.exports = function(grunt) {
},
addons: {
files: [{ expand: true, src: ["addons/src/**/*.js"], dest: "dist/addons/js", flatten: true }]
},
scss: {
files: [{ expand: true, cwd: "src/less", src: ["*"], dest: "src/scss/", ext: '.scss' }]
},
scssthemes: {
files: [{ expand: true, src: "themes/**/*.less", ext: '.scss' }]
}
},

// convert LESS to SCSS
replace: {
scss: {
src: ['src/scss/*.scss', 'themes/**/*.scss'], // source files array
overwrite: true,
// dest: 'build/text/', // destination directory or file
replacements: [ { // replace comments
from: ' LESS ', to: ' SCSS '
}, { // change less/ dir to scss/ on imports
from: '/less/', to: '/scss/'
}, { // change .less extensions to .scss on imports
from: '\.less', to: '\.scss'
}, { // replace '@' with '$'
from: '@', to: '$'
}, { // mixins
from: /\.([\w\-]*)\s*\((.*)\)\s*\{/g, to: '@mixin $1($2){'
}, { // includes
from: /\.([\w\-]*\(.*\)\s*;)/g, to: '@include $1'
}, { // replace valid '@' statements
from: /\$(import|media|font-face)/g, to: '@$1'
}, { // string literals
// from: /~"(.*)"/g, to: '#{"$1"}'
from: /\$\{/g, to: '#{'
}]
}
},

Expand Down Expand Up @@ -333,10 +366,12 @@ module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-compress");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-text-replace");
grunt.loadNpmTasks("grunt-banner");

// Register grunt tasks
grunt.registerTask("build", ["jshint", "indexthemes", "less", "concat", "copy", "uglify", "usebanner"]);
grunt.registerTask("build-scss", ["copy:scss", "copy:scssthemes", "replace:scss"]);
grunt.registerTask("default", ["build", "compress"]);

};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"grunt-contrib-jshint": "0.1.1",
"grunt-contrib-uglify": "0.1.1",
"grunt-contrib-watch": "0.2.0",
"grunt-text-replace": "~0.3.10",
"grunt-banner": "0.1.4",
"grunt": "~0.4.0"
},
Expand Down
19 changes: 13 additions & 6 deletions src/less/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,22 @@
// Breakpoints
//

@breakpoint-mini-max: (@breakpoint-small - 1);
@breakpoint-xlarge: 1220px;

@breakpoint-small: 480px;
@breakpoint-small-max: (@breakpoint-medium - 1);
@breakpoint-large: 960px;
@breakpoint-large-max: (@breakpoint-xlarge - 1);

@breakpoint-medium: 768px;
@breakpoint-medium-max: (@breakpoint-large - 1);

@breakpoint-large: 960px;
@breakpoint-large-max: (@breakpoint-xlarge - 1);
@breakpoint-small: 480px;
@breakpoint-small-max: (@breakpoint-medium - 1);

@breakpoint-mini-max: (@breakpoint-small - 1);


//
// Font
//

@breakpoint-xlarge: 1220px;
@base-code-font-family: Consolas, monospace, serif;