Skip to content

Commit

Permalink
hello-theme: scss, readme, gruntfile & hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
nuritsha committed Dec 24, 2018
1 parent acc02f0 commit fc65877
Show file tree
Hide file tree
Showing 11 changed files with 153 additions and 911 deletions.
44 changes: 0 additions & 44 deletions .grunt-config/checktextdomain.js

This file was deleted.

42 changes: 0 additions & 42 deletions .grunt-config/postcss.js

This file was deleted.

16 changes: 0 additions & 16 deletions .grunt-config/sass.js

This file was deleted.

13 changes: 0 additions & 13 deletions .grunt-config/watch.js

This file was deleted.

10 changes: 0 additions & 10 deletions .grunt-config/wp_readme_to_markdown.js

This file was deleted.

137 changes: 115 additions & 22 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,140 @@
/**
* Elementor Hello Theme Makefile
*/
'use strict';

module.exports = function( grunt ) {
'use strict';

const fs = require( 'fs' ),
pkgInfo = grunt.file.readJSON( 'package.json' );
require( 'matchdep' ).filterDev( 'grunt-*' ).forEach( grunt.loadNpmTasks );

require( 'load-grunt-tasks' )( grunt );

// Project configuration
// Project configuration.
grunt.initConfig( {
pkg: pkgInfo,
pkg: grunt.file.readJSON( 'package.json' ),

banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("dd-mm-yyyy") %> */',
sass: {
dist: {
files: [ {
expand: true,
cwd: 'assets/scss',
src: '*.scss',
dest: './',
ext: '.css'
} ]
}
},

checktextdomain: require( './.grunt-config/checktextdomain' ),
sass: require( './.grunt-config/sass' ),
postcss: require( './.grunt-config/postcss' ),
watch: require( './.grunt-config/watch' ),
wp_readme_to_markdown: require( './.grunt-config/wp_readme_to_markdown' ),
} );
postcss: {
dev: {
options: {
//map: true,

// Default task(s).
grunt.registerTask( 'default', [
'i18n',
'wp_readme_to_markdown',
'styles',
] );
processors: [
require( 'autoprefixer' )( {
browsers: 'last 10 versions'
} )
]
},
files: [ {
src: [
'*.css',
'!*.min.css'
]
} ]
},
minify: {
options: {
processors: [
require( 'autoprefixer' )( {
browsers: 'last 10 versions'
} ),
require( 'cssnano' )()
]
},
files: [ {
//expand: true,
src: [
'*.css',
'!*.min.css'
],
ext: '.min.css'
} ]
}
},

watch: {
styles: {
files: [
'assets/scss/**/*.scss'
],
tasks: [ 'styles' ]
}
},

checktextdomain: {
options: {
text_domain: 'elementor-hello-theme',
correct_domain: true,
keywords: [
// WordPress keywords
'__:1,2d',
'_e:1,2d',
'_x:1,2c,3d',
'esc_html__:1,2d',
'esc_html_e:1,2d',
'esc_html_x:1,2c,3d',
'esc_attr__:1,2d',
'esc_attr_e:1,2d',
'esc_attr_x:1,2c,3d',
'_ex:1,2c,3d',
'_n:1,2,4d',
'_nx:1,2,4c,5d',
'_n_noop:1,2,3d',
'_nx_noop:1,2,3c,4d'
]
},
files: {
src: [
'**/*.php',
'!docs/**',
'!bin/**',
'!node_modules/**',
'!build/**',
'!tests/**',
'!.github/**',
'!vendor/**',
'!*~'
],
expand: true
},
},

wp_readme_to_markdown: {
readme: {
files: {
'README.md': 'readme.txt'
}
}
}

} );

grunt.registerTask( 'i18n', [
'checktextdomain',
] );

grunt.registerTask( 'wp_readme', [
'wp_readme_to_markdown',
] );

grunt.registerTask( 'styles', [
'sass',
'postcss'
] );

// Default task(s).
grunt.registerTask( 'default', [
'styles'
'i18n',
'styles',
'wp_readme',
] );
};
42 changes: 15 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,26 @@



**Contributors:** [elemntor](https://profiles.wordpress.org/elemntor), [KingYes](https://profiles.wordpress.org/KingYes), [ariel.k](https://profiles.wordpress.org/ariel.k), [jzaltzberg](https://profiles.wordpress.org/jzaltzberg), [mati1000](https://profiles.wordpress.org/mati1000), [pojosh](https://profiles.wordpress.org/pojosh), [bainternet](https://profiles.wordpress.org/bainternet), [nrt.soda](https://profiles.wordpress.org/nrt.soda)
**Contributors:** [elemntor](https://profiles.wordpress.org/elemntor)
**Requires at least:** WordPress 4.7
**Tested up to:** WordPress 5.0
**Stable tag:** 1.0
**Version:** 2.0
**Version:** 1.0
**License:** GNU General Public License v3 or later
**License URI:** https://www.gnu.org/licenses/gpl-3.0.html
**Tags:** Elementor, ElementorPro, flexible-header, accessibility-ready, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
**Tags:** flexible-header, accessibility-ready, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready

The theme for Elementor.

## Description ##

A plain-vanilla theme, best suited for building your site using **Elementor** & **Elementor Pro**.
This theme resets the environment and prepare it for smooth operation of Elementor.
A plain-vanilla theme, best suited for building your site using Elementor.
This theme resets the environment and prepares it for smooth operation of Elementor.

Please note that we do not provide support for customizing the theme (as it should not be required, for customizing your site, use **Elementor!**).

## Installation ##

1. In your admin panel, go to Appearance > Themes and click the 'Add New' button.
2. Type in 'Elementor Hello' in the search form and hit the 'Enter' key on your keyboard.
3. Click on the 'Activate' button to use your new theme right away.
4. Navigate to Elementor and start building your site.

## Customizing ##
If you wish to customize your theme & site, just use **Elementor!**.

### Hooks ###

to prevent the loading of any of the following settings, add the following code to your child-theme functions.php:

`add_filter( 'choose-from-the-list-below', '__return_false' );`
Expand All @@ -50,6 +42,13 @@ However, if for some reason there is still a need to add or change the site's cs
2. in order to change any of the values defined in `preset/variables.scss`, add your style code to `custom/pre_default.scss`.
3. any new scss files should be located under `custom/` directory, and imported in `custom/custom.scss`.

## Installation ##

1. In your admin panel, go to Appearance > Themes and click the 'Add New' button.
2. Type in 'Elementor Hello' in the search form and hit the 'Enter' key on your keyboard.
3. Click on the 'Activate' button to use your new theme right away.
4. Navigate to Elementor and start building your site.

## Frequently Asked Questions ##

* Does this theme support any plugins?
Expand All @@ -60,20 +59,9 @@ Elementor Hello includes support for WooCommerce.

Best practice is to use the styling capabilities in the Elementor plugin.

## Copyright ##

Elementor Hello Theme, Copyright 2018 Elementor.com
Elementor Hello Theme is distributed under the terms of the GNU GPL

Elementor Hello Theme bundles the following third-party resources:

normalize.css v8.0.0, Copyright © Nicolas Gallagher and Jonathan Neal
License: MIT
Source: https://github.com/necolas/normalize.css

## Changelog ##

### 1.0 ###
* Released: December 11, 2018

Initial release
Initial release
6 changes: 5 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'single' ) ) {
get_template_part( 'template-parts/single' );
}
} elseif ( is_archive() || is_home() || is_search() ) {
} elseif ( is_archive() || is_home() ) {
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'archive' ) ) {
get_template_part( 'template-parts/archive' );
}
} elseif ( is_search() ) {
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'archive' ) ) {
get_template_part( 'template-parts/search' );
}
} else {
if ( ! $is_elementor_theme_exist || ! elementor_theme_do_location( 'single' ) ) {
get_template_part( 'template-parts/404' );
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@
"grunt-wp-readme-to-markdown-with-extra": "~2.2.0",
"load-grunt-tasks": "^4.0.0",
"matchdep": "~2.0.0"
},
"dependencies": {
"grunt-autoprefixer": "^3.0.4",
"grunt-cssnano": "^2.1.0"
}
}
Loading

0 comments on commit fc65877

Please sign in to comment.