Skip to content

Commit a83de38

Browse files
committed
Updated files to match divi repo.
1 parent 9dabb65 commit a83de38

19 files changed

Lines changed: 219 additions & 21 deletions

Gruntfile.js

Lines changed: 99 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,102 @@ module.exports = function (grunt) {
66
grunt.initConfig({
77
pkg: grunt.file.readJSON('package.json'),
88

9+
// Clean
910
clean: {
1011
release: [
11-
'package.json',
12-
'bower.json', '.bowerrc',
13-
'.gitignore', '.gitmodules',
14-
'scss', '*.scss', '*.sass', '*.map', '.sass-cache',
15-
'bower_components', 'Gruntfile.js', 'node_modules',
12+
'package.json', '.DS_STORE',
13+
'bower.json', '.bowerrc', 'bower_components',
14+
'.gitignore', '.gitmodules', '.gitattributes',
15+
'scss', '*.scss', '*.sass', '*.map', '.sass-cache', 'csscomb.json',
16+
'Gruntfile.js', 'node_modules'
1617
]
1718
},
1819

20+
// Compress
21+
compress: {
22+
release : {
23+
options : {
24+
archive : '../<%= pkg.name %>.zip',
25+
mode : 'zip',
26+
level : 9
27+
},
28+
files : [
29+
{
30+
expand : true,
31+
src : [
32+
'**',
33+
'!**/.git/**',
34+
'!**/.gitignore',
35+
'!**/.gitmodules',
36+
'!**/.git',
37+
'!**/.DS_STORE/**',
38+
'!**/*.zip',
39+
'!**/styles/**',
40+
'!.sass-cache',
41+
'!csscomb.json',
42+
'!**/*.map',
43+
'!**/.bowerrc',
44+
'!**/bower.json',
45+
'!**/node_modules/**',
46+
'!**/package.json',
47+
'!**/Gruntfile.js',
48+
],
49+
dest : '<%= pkg.name %>'
50+
}
51+
]
52+
}
53+
},
54+
1955
// Sass
2056
sass: {
57+
options: {
58+
precision: 6,
59+
style: 'expanded',
60+
},
61+
2162
dev: {
2263
options: {
23-
precision: 6,
24-
sourcemap: 'auto',
25-
style: 'expanded',
64+
sourcemap: 'auto'
2665
},
2766
files: {
28-
'style.css': 'styles/style.scss'
67+
'style.css': 'styles/scss/style.scss'
2968
}
3069
},
3170

3271
dist: {
3372
options: {
34-
precision: 6,
35-
sourcemap: false,
36-
style: 'expanded',
73+
sourcemap: false
3774
},
3875
files: {
39-
'style.css': 'styles/style.scss'
76+
'style.css': 'styles/scss/style.scss'
77+
}
78+
}
79+
},
80+
81+
// Less
82+
less: {
83+
options: {
84+
compress: false,
85+
strictUnits: true
86+
},
87+
88+
dev: {
89+
options: {
90+
sourceMap: true,
91+
strictUnits: true
92+
},
93+
files: {
94+
'style.css': 'styles/less/style.less'
95+
}
96+
},
97+
98+
dist: {
99+
options: {
100+
sourceMap: true,
101+
strictUnits: true
102+
},
103+
files: {
104+
'style.css': 'styles/less/style.less'
40105
}
41106
}
42107
},
@@ -45,7 +110,7 @@ module.exports = function (grunt) {
45110
csscomb: {
46111
dist: {
47112
options: {
48-
config: 'csscomb.json'
113+
config: 'styles/.csscomb.json'
49114
},
50115
files: {
51116
'style.css': ['style.css'],
@@ -120,6 +185,12 @@ module.exports = function (grunt) {
120185
options: {
121186
message: 'Sass files has been compiled.'
122187
}
188+
},
189+
190+
less: {
191+
options: {
192+
message: 'Less files has been compiled.'
193+
}
123194
}
124195
},
125196

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

145216
sass: {
146-
files: '*/**.{scss,sass}',
147-
tasks: ['dev', 'notify:sass'],
217+
files: '**/*.{scss,sass}',
218+
tasks: ['sass-dev', 'notify:sass'],
219+
},
220+
221+
less: {
222+
files: '**/*.less',
223+
tasks: ['less-dev', 'notify:less'],
148224
}
149225
}
150226
});
151227

152-
grunt.registerTask('dist', ['sass:dist', 'csscomb:dist', 'postcss:dist', 'cssmin:dist', 'notify:release', 'clean:release']);
153-
grunt.registerTask('dev', ['sass:dev', 'postcss:dev']);
154-
grunt.registerTask('default', ['notify:init', 'dev', 'watch']);
228+
grunt.registerTask('sass-dist', ['sass:dist', 'csscomb:dist', 'postcss:dist', 'cssmin:dist', 'notify:release', 'compress:release']);
229+
grunt.registerTask('sass-dev', ['sass:dev', 'postcss:dev']);
230+
231+
grunt.registerTask('less-dist', ['less:dist', 'csscomb:dist', 'postcss:dist', 'cssmin:dist', 'notify:release', 'compress:release']);
232+
grunt.registerTask('less-dev', ['less:dev', 'postcss:dev']);
233+
234+
grunt.registerTask('default', ['notify:init', 'watch']);
155235
};

README.md

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,77 @@
1-
# Extra Child Theme Template
1+
# Extra Child Theme Template
2+
This is a premade template for creating a Extra Child Theme. This repo comes preinstalled with 3 different paths...
3+
- [CSS](#css-path)
4+
- [Preprocessor](#preprocessor-path)
5+
6+
## CSS Path
7+
If you don't have any experience working with preprocessors, this is the best path for you.
8+
9+
#### Step 1: Cloning the Repo
10+
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.
11+
12+
1. Let's start by navigating to your `wp-content/themes` folder instead your WordPress directory.
13+
2. Once you're there, open `terminal` in the current folder.
14+
3. Now with `terminal`, use the following commands to clone: `git clone git@github.com:elegantthemes/extra-child-theme-init.git`
15+
16+
#### Step 2: Development
17+
Now that you have the repo cloned or installed, you can start development.
18+
19+
1. If you haven't already, navigate to your `extra-child-theme-init folder`.
20+
2. Open up `style.css` in your favorite editor and code away!
21+
22+
23+
## Preprocessor Path
24+
If you want to speed up your development, you can choose one of the following preprocessors installed.
25+
26+
#### Requirements
27+
Below are a list of applications/software that you will need preinstalled before continuing down this path.
28+
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
29+
- [Node.js](http://nodejs.org/)
30+
- [GruntJS](http://gruntjs.com/) - _A JavaScript Task Runner_
31+
- [Sass](http://sass-lang.com/install) - _If you're using Sass/Scss_
32+
33+
34+
#### Step 1: Installing Node.js
35+
The first step is getting NodeJS installed. If you already have it installed go ahead and skip to step [#2](#step-2-installing-gruntjs).
36+
37+
1. Head over to `https://nodejs.org/en/` and install the latest version of Node.js
38+
2. Now that it's installed, run `node -v` to verify that you have the latest version installed.
39+
3. Head over to step [#2](#step-2-installing-gruntjs).
40+
41+
42+
#### Step 2: Installing GruntJS
43+
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).
44+
45+
1. Now that you have Node installed, let's install GruntJS by running the following command: `npm install -g grunt-cli`.
46+
2. Head over to step [#3](#step-3-installing-git).
47+
48+
-
49+
50+
#### Step 3: Installing Git
51+
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).
52+
53+
1. Go to `https://git-scm.com/book/en/v2/Getting-Started-Installing-Git` and follow the to installing git for the correct machine.
54+
2. Head over to step [#4](#step-4-cloning-repo).
55+
56+
-
57+
58+
#### Step 4: Cloning Repo
59+
1. With git now installed, navigate to `wp-content/themes` folder.
60+
2. Clone the repo using the following command: `git clone git@github.com:elegantthemes/extra-child-theme-init.git`.
61+
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.
62+
3. Head over to step [#5](#step-5-installing-packages).
63+
64+
-
65+
66+
#### Step 5: Installing Packages
67+
1. From current directory, install node packages with the following command: `npm install`.
68+
2. Head over to step [#6](#step-6-running-grunt).
69+
70+
-
71+
72+
#### Step 6: Running Grunt
73+
1. From the current directory, run the following command: `grunt`.
74+
2. Once grunt has been initiated, you can start your development.
75+
76+
## Copyright & License
77+
Copyright 2015 ElegantThemes. Code released under the [GNU license](https://github.com/elegantthemes/extra-child-theme-init/blob/master/LICENSE).

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
},
2222
"devDependencies": {
2323
"autoprefixer": "^6.0.3",
24+
"grunt-contrib-compress": "^0.14.0",
2425
"grunt-contrib-cssmin": "^0.14.0",
26+
"grunt-contrib-less": "^1.1.0",
2527
"grunt-contrib-sass": "^0.9.2",
2628
"grunt-contrib-watch": "^0.6.1",
2729
"grunt-csscomb": "^3.1.0",

screenshot.png

7.56 KB
Loading
File renamed without changes.

0 commit comments

Comments
 (0)