Skip to content

Commit

Permalink
Updated files to match divi repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
andyhqtran committed Dec 14, 2015
1 parent 9dabb65 commit a83de38
Show file tree
Hide file tree
Showing 19 changed files with 219 additions and 21 deletions.
118 changes: 99 additions & 19 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,102 @@ module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

// Clean
clean: {
release: [
'package.json',
'bower.json', '.bowerrc',
'.gitignore', '.gitmodules',
'scss', '*.scss', '*.sass', '*.map', '.sass-cache',
'bower_components', 'Gruntfile.js', 'node_modules',
'package.json', '.DS_STORE',
'bower.json', '.bowerrc', 'bower_components',
'.gitignore', '.gitmodules', '.gitattributes',
'scss', '*.scss', '*.sass', '*.map', '.sass-cache', 'csscomb.json',
'Gruntfile.js', 'node_modules'
]
},

// Compress
compress: {
release : {
options : {
archive : '../<%= pkg.name %>.zip',
mode : 'zip',
level : 9
},
files : [
{
expand : true,
src : [
'**',
'!**/.git/**',
'!**/.gitignore',
'!**/.gitmodules',
'!**/.git',
'!**/.DS_STORE/**',
'!**/*.zip',
'!**/styles/**',
'!.sass-cache',
'!csscomb.json',
'!**/*.map',
'!**/.bowerrc',
'!**/bower.json',
'!**/node_modules/**',
'!**/package.json',
'!**/Gruntfile.js',
],
dest : '<%= pkg.name %>'
}
]
}
},

// Sass
sass: {
options: {
precision: 6,
style: 'expanded',
},

dev: {
options: {
precision: 6,
sourcemap: 'auto',
style: 'expanded',
sourcemap: 'auto'
},
files: {
'style.css': 'styles/style.scss'
'style.css': 'styles/scss/style.scss'
}
},

dist: {
options: {
precision: 6,
sourcemap: false,
style: 'expanded',
sourcemap: false
},
files: {
'style.css': 'styles/style.scss'
'style.css': 'styles/scss/style.scss'
}
}
},

// Less
less: {
options: {
compress: false,
strictUnits: true
},

dev: {
options: {
sourceMap: true,
strictUnits: true
},
files: {
'style.css': 'styles/less/style.less'
}
},

dist: {
options: {
sourceMap: true,
strictUnits: true
},
files: {
'style.css': 'styles/less/style.less'
}
}
},
Expand All @@ -45,7 +110,7 @@ module.exports = function (grunt) {
csscomb: {
dist: {
options: {
config: 'csscomb.json'
config: 'styles/.csscomb.json'
},
files: {
'style.css': ['style.css'],
Expand Down Expand Up @@ -120,6 +185,12 @@ module.exports = function (grunt) {
options: {
message: 'Sass files has been compiled.'
}
},

less: {
options: {
message: 'Less files has been compiled.'
}
}
},

Expand All @@ -143,13 +214,22 @@ module.exports = function (grunt) {
},

sass: {
files: '*/**.{scss,sass}',
tasks: ['dev', 'notify:sass'],
files: '**/*.{scss,sass}',
tasks: ['sass-dev', 'notify:sass'],
},

less: {
files: '**/*.less',
tasks: ['less-dev', 'notify:less'],
}
}
});

grunt.registerTask('dist', ['sass:dist', 'csscomb:dist', 'postcss:dist', 'cssmin:dist', 'notify:release', 'clean:release']);
grunt.registerTask('dev', ['sass:dev', 'postcss:dev']);
grunt.registerTask('default', ['notify:init', 'dev', 'watch']);
grunt.registerTask('sass-dist', ['sass:dist', 'csscomb:dist', 'postcss:dist', 'cssmin:dist', 'notify:release', 'compress:release']);
grunt.registerTask('sass-dev', ['sass:dev', 'postcss:dev']);

grunt.registerTask('less-dist', ['less:dist', 'csscomb:dist', 'postcss:dist', 'cssmin:dist', 'notify:release', 'compress:release']);
grunt.registerTask('less-dev', ['less:dev', 'postcss:dev']);

grunt.registerTask('default', ['notify:init', 'watch']);
};
78 changes: 77 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,77 @@
# Extra Child Theme Template
# Extra Child Theme Template
This is a premade template for creating a Extra Child Theme. This repo comes preinstalled with 3 different paths...
- [CSS](#css-path)
- [Preprocessor](#preprocessor-path)

## CSS Path
If you don't have any experience working with preprocessors, this is the best path for you.

#### Step 1: Cloning the Repo
The first step to getting start with building a child theme is cloning this repo. If you don't have [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) installed, you can download the [ZIP file](https://github.com/elegantthemes/Edition/archive/master.zip) and drop it into your `wp-content/themes` folder.

1. Let's start by navigating to your `wp-content/themes` folder instead your WordPress directory.
2. Once you're there, open `terminal` in the current folder.
3. Now with `terminal`, use the following commands to clone: `git clone git@github.com:elegantthemes/extra-child-theme-init.git`

#### Step 2: Development
Now that you have the repo cloned or installed, you can start development.

1. If you haven't already, navigate to your `extra-child-theme-init folder`.
2. Open up `style.css` in your favorite editor and code away!


## Preprocessor Path
If you want to speed up your development, you can choose one of the following preprocessors installed.

#### Requirements
Below are a list of applications/software that you will need preinstalled before continuing down this path.
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- [Node.js](http://nodejs.org/)
- [GruntJS](http://gruntjs.com/) - _A JavaScript Task Runner_
- [Sass](http://sass-lang.com/install) - _If you're using Sass/Scss_


#### Step 1: Installing Node.js
The first step is getting NodeJS installed. If you already have it installed go ahead and skip to step [#2](#step-2-installing-gruntjs).

1. Head over to `https://nodejs.org/en/` and install the latest version of Node.js
2. Now that it's installed, run `node -v` to verify that you have the latest version installed.
3. Head over to step [#2](#step-2-installing-gruntjs).


#### Step 2: Installing GruntJS
The next step is setting up GruntJS locally. If you already have it installed go ahead and skip to step [#3](#step-3-installing-git).

1. Now that you have Node installed, let's install GruntJS by running the following command: `npm install -g grunt-cli`.
2. Head over to step [#3](#step-3-installing-git).

-

#### Step 3: Installing Git
After installing Node and Grunt, you can now install Git. If you already have it installed go ahead and skip to step [#4](#step-4-cloning-repo).

1. Go to `https://git-scm.com/book/en/v2/Getting-Started-Installing-Git` and follow the to installing git for the correct machine.
2. Head over to step [#4](#step-4-cloning-repo).

-

#### Step 4: Cloning Repo
1. With git now installed, navigate to `wp-content/themes` folder.
2. Clone the repo using the following command: `git clone git@github.com:elegantthemes/extra-child-theme-init.git`.
3. Now with the repo cloned, you can navigate to it by typing in `cd ` and dragging the extra child theme folder into your terminal.
3. Head over to step [#5](#step-5-installing-packages).

-

#### Step 5: Installing Packages
1. From current directory, install node packages with the following command: `npm install`.
2. Head over to step [#6](#step-6-running-grunt).

-

#### Step 6: Running Grunt
1. From the current directory, run the following command: `grunt`.
2. Once grunt has been initiated, you can start your development.

## Copyright & License
Copyright 2015 ElegantThemes. Code released under the [GNU license](https://github.com/elegantthemes/extra-child-theme-init/blob/master/LICENSE).
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
},
"devDependencies": {
"autoprefixer": "^6.0.3",
"grunt-contrib-compress": "^0.14.0",
"grunt-contrib-cssmin": "^0.14.0",
"grunt-contrib-less": "^1.1.0",
"grunt-contrib-sass": "^0.9.2",
"grunt-contrib-watch": "^0.6.1",
"grunt-csscomb": "^3.1.0",
Expand Down
Binary file added screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
34 changes: 34 additions & 0 deletions styles/less/style.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
Theme Name: Extra Child Theme
Theme URI: http://elegantthemes.com/
Description: Extra Child Theme
Author: ElegantThemes
Author URI: http://elegantthemes.com
Template: Extra
Version: 0.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: responsive-layout, one-column, two-columns, three-columns, four-columns, left-sidebar, right-sidebar, custom-background, custom-colors, featured-images, full-width-template, post-formats, rtl-language-support, theme-options, threaded-comments, translation-ready
Text Domain: extra-child-theme
*/

// Variables
@import "base/variables";

// Mixins
@import "base/mixins";

/* Body */
body {}

/* Header */
@import "partials/header";

/* Button */
@import "partials/button";

/* Input */
@import "partials/input";

/* Footer */
@import "partials/footer";
Empty file added styles/scss/base/_mixins.scss
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
8 changes: 7 additions & 1 deletion styles/style.scss → styles/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: responsive-layout, one-column, two-columns, three-columns, four-columns, left-sidebar, right-sidebar, custom-background, custom-colors, featured-images, full-width-template, post-formats, rtl-language-support, theme-options, threaded-comments, translation-ready
Text Domain: divi-child-theme
Text Domain: extra-child-theme
*/

// Variables
@import "base/variables";

// Mixins
@import "base/mixins";

/* Body */
body {}

Expand Down

0 comments on commit a83de38

Please sign in to comment.