UNPKG

generator-wp-theme

Version:

A WordPress theme YeoMan generator, to kickstart WordPress theme development with yo, sass and grunt

383 lines (333 loc) 13 kB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <head lang="en"> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <title>Theme Documentation: <%= themeName %></title> <!-- Framework CSS --> <link rel="stylesheet" href="assets/blueprint-css/screen.css" type="text/css" media="screen, projection"> <link rel="stylesheet" href="assets/blueprint-css/print.css" type="text/css" media="print"> <!--[if lt IE 8]><link rel="stylesheet" href="assets/blueprint-css/ie.css" type="text/css" media="screen, projection"><![endif]--> <link rel="stylesheet" href="assets/blueprint-css/plugins/fancy-type/screen.css" type="text/css" media="screen, projection"> <style type="text/css" media="screen"> p, table, hr, .box { margin-bottom:25px; } .box p { margin-bottom:10px; } </style> </head> <body> <div class="container"> <h3 class="center alt">&ldquo;<%= themeName %>&rdquo; Documentation by <a href="<%= themeName %>"><%= themeAuthorURI %></a> - v1.0</h3> <hr> <h1 class="center">&ldquo;<%= themeName %>&rdquo;</h1> <div class="borderTop"> <div class="span-6 colborder info prepend-1"> <p class="prepend-top"> <strong> Created: <%= themeCreated %><br> By: <%= themeAuthor %><br> Contact: <a href="<%= themeAuthorURI %>"><%= themeAuthorURI %></a> </strong> </p> </div><!-- end div .span-6 --> <div class="span-12 last"> <p class="prepend-top append-0">Thank you for purchasing our theme. If you have any questions that are beyond the scope of this help file, please feel free to email via our user page contact form <a href="http://themeforest.net/user/USERNAME">here</a>. Thanks so much!</p> </div> </div><!-- end div .borderTop --> <hr> <h2 id="toc" class="alt">Table of Contents</h2> <ol class="alpha"> <li><a href="#design">Design</a></li> <li><a href="#wpcustomizer">Customization</a></li> <li><a href="#childthemes">Child themes</a></li> <li><a href="#htmlStructure">HTML Structure</a></li> <li><a href="#scssFiles">SCSS Files and Structure</a></li> <li><a href="#fonts">Fonts</a></li> <li><a href="#javascript">JavaScript</a></li> <li><a href="#grunt">Grunt</a></li> <li><a href="#credits">Sources and Credits</a></li> </ol> <hr> <h3 id="design"><strong>A) Design</strong> - <a href="#toc">top</a></h3> <p> Basic thoughts on the design. </p> <hr> <h3 id="wpcustomizer"><strong>B) Customization</strong> - <a href="#toc">top</a></h3> <p> Description on how to customize the theme. </p> <hr> <h3 id="childthemes"><strong>C) Child themes</strong> - <a href="#toc">top</a></h3> <p> The <%= themeName %>-theme of course provides child-theme support. </p> <p> If you want to change some css-styling. Following the WordPress child-theme guidelines, the child-themes <em>style.css</em> should begin like this: <pre> /* Theme Name: <%= themeName %> childtheme Theme URI: http://example.com/ Description: Description <%= themeName %> Author: John Doe Author URI: http://example.com/john-doe Template: <%= themeName %> Version: 1.0.0 */ @import url("../<%= themeNameSpace %>/style.css"); /******************************************************************************\ Theme customization starts here \******************************************************************************/ </pre> If you would like to edit the color, font, or style of any elements in one of these columns, you would do the following: </p> <pre> .primary a { color: #someColor; } </pre> <p> If you find that the new style is not overriding, it is most likely because of a specificity problem. Scroll down in the CSS file and make sure that there isn't a similar style that has more weight. </p> <p>I.E.</p> <pre> .site .primary.page-content a { color: #someColor; } </pre> <p> So, to ensure that the new styles are applied, make sure that they carry enough "weight" and that there isn't a style lower in the CSS file that is being applied after them. </p> <hr> <h3 id="htmlStructure"><strong>D) HTML Structure</strong> - <a href="#toc">top</a></h3> <p> Description of the HTML-structure of the theme. </p> <hr> <h3 id="scssFiles"><strong>E) SCSS Files and Structure</strong> - <a href="#toc">top</a></h3> <p> All the themes CSS is compiled from SASS/SCSS stylesheets. You find them in the themes <em>scss</em> directory. The <em>style.scss</em> file is the main file, which gets compiled to the themes <em>style.css</em> file. It includes the underscored files in the same directory, which each handle a separate part of the layout. The names should be self-explaining, however a short overview in including order follows. <dl> <dt><em>vendor/normalize</em></dt> <dd> Includes the normalizing css.<br /><br /> </dd> <dt><em>vendor/bourbon/bourbon</em></dt> <dd> Includes the great bourbon mixin library.<br /><br /> </dd> <dt><em>_base.scss</em></dt> <dd> Defines the main colors of the themes and basic HTML-element styling.<br /><br /> </dd> <dt><em>_grid-settings.scss</em></dt> <dd> Defines and includes the base setup for the themes grid. The default grid is bourbons neat.<br /><br /> </dd> <dt><em>_typography.scss</em></dt> <dd> Defines all fonts, typography related mixins and HTML-element styles. Defines even some font-size variables.<br /><br /> </dd> <dt><em>_components.scss</em></dt> <dd> Here should be placed the basic mixins and placeholders for the theme.<br /><br /> </dd> <dt><em>_wp-base.scss</em></dt> <dd> Defines some basic WordPress classes, like <em>sticky</em>, <em>alignleft</em> or <em>bypostauthor</em>.<br /><br /> </dd> <dt><em>_header.scss</em></dt> <dd> Contains the header styles.<br /><br /> </dd> <dt><em>_navigation.scss</em></dt> <dd> Contains the navigation styles.<br /><br /> </dd> <dt><em>_content.scss</em></dt> <dd> Contains the basic content styles for posts and pages. <br /><br /> </dd> <dt><em>_post-formats.scss</em></dt> <dd> Extends the content styling with styling for multiple WordPress post formats.<br /><br /> </dd> <dt><em>_footer.scss</em></dt> <dd> Contains the footer styles.<br /><br /> </dd> </dl> </p> <p> To compile the SCSS files use a precompiling tool. This theme has been build with help of <em>grunt</em> and provides a basic grunt-configuration. So if you are using <em>grunt</em> you can start right away, after reading the <a href="#grunt">grunt</a> section. </p> <hr> <h3 id="fonts"><strong>F) Fonts</strong> - <a href="#toc">top</a></h3> <p> Description of the themes fonts. </p> <hr> <h3 id="javascript"><strong>G) JavaScript</strong> - <a href="#toc">top</a></h3> <p> The following JavaScript files/frameworks are used bby this theme. </p> <dl> <dt><em>HTML5 shiv for IE (js/html5shiv.js)</em></dt> <dd> Making HTML5-elements work in older IE verions. Included by conditional comment only on IE-versions that need it. <br /><br /> </dd> <dt><em>WordPress standard jQuery</em></dt> <dd> The current jQuery version, shipping with WordPress.<br /> <br /> </dd> <dt><em>Scripts (js/scripts.js)</em></dt> <dd> This themes JavaScripts.<br /><br /> </dd> </dl> <hr> <h3 id="grunt"><strong>H) Grunt</strong> - <a href="#toc">top</a></h3> <p> This theme provides a basic grunt configuration. All grunt related assets like the <em>gruntfile.js</em> and the <em>package.js</em> are placed in the <em>grunt<em> directory. </p> <p> I assume you are familiar with <em>nodejs</em>, <em>npm</em> and <em>grunt</em> and have it up end running, otherwise: start <a href="http://gruntjs.com/" title="gruntjs">here</a>. </p> <p> To setup grunt for this theme, go to the <em>grunt</em> directory and run <pre> npm install --save-dev </pre> </p> <p> That will install all needed node modules in <em>grunt/node_modules</em>. After the installing process is done, you can manage the following available tasks, by running these commands: <dl> <dt><em>grunt</em></dt> <dd> Is running the default task-list, which is the same as running <em>grunt jshint</em>, <em>grunt uglify</em> and <em>grunt sass</em>. <br /><br /> </dd> <dt><em>grunt jshint</em></dt> <dd> Checks the JavaScript files and gives you some hints. <br /><br /> </dd> <dt><em>grunt uglify</em></dt> <dd> Takes the JavaScript files and concatenates and minifies it to one file: <em>js/scripts.min.js</em>, which is included in the theme. <br /><br /> </dd> <dt><em>grunt sass:dev</em></dt> <dd> Is compiling all the scss files to one <em>expanded</em> style.css in the themes root directory. <br /><br /> </dd> <dt><em>grunt sass:prod</em></dt> <dd> Is compiling all the scss files to one <em>compressed</em> style.css in the themes root directory. <br /><br /> </dd> <dt><em>grunt watch</em></dt> <dd> Watches the scss and js files for changes and runs the above tasks automatically, plus giving you a cross-OS desktop notice on success. <br /><br /> </dd> <dt><em>grunt dist</em></dt> <dd> Runs <em>grunt uglify</em> and <em>grunt sass:prod</em>, takes all the production relevant theme files and places them in the <em>dist</em> directory under the themes root. Now the <em>dist</em> directory contains a production ready theme, which can be uploaded to a live server. <br /><br /> </dd> <dt><em>grunt phpcs</em></dt> <dd> <b>Requires PHP CodeSniffer with WordPress standard installed in the development environment.</b><br /> Checks the themes php files against the WordPress coding standards. <br /><br /> </dd> </dl> </p> <hr> <h3 id="credits"><strong>I) Sources and Credits</strong> - <a href="#toc">top</a></h3> <p>We've used the following third party scripts and tools. <ul> <li><a href="http://bourbon.io/" title="bourbon">bourbon</a></li> <li><a href="http://neat.bourbon.io/" title="bourbon-neat">bourbon-neat</a></li> <li><a href="http://gruntjs.com/" title="grunt">grunt</a></li> <li><a href="http://github.com/gruntjs/grunt-contrib-clean" title="grunt-contrib-clean">grunt-contrib-clean</a></li> <li><a href="http://github.com/gruntjs/grunt-contrib-copy" title="grunt-contrib-copy">grunt-contrib-copy</a></li> <li><a href="http://github.com/gruntjs/grunt-contrib-jshint" title="grunt-contrib-jshint">grunt-contrib-jshint</a></li> <li><a href="http://github.com/gruntjs/grunt-contrib-sass" title="grunt-contrib-sass">grunt-contrib-sass</a></li> <li><a href="http://github.com/gruntjs/grunt-contrib-uglify" title="grunt-contrib-uglify">grunt-contrib-uglify</a></li> <li><a href="http://github.com/gruntjs/grunt-contrib-watch" title="grunt-contrib-watch">grunt-contrib-watch</a></li> <li><a href="http://github.com/clavery/grunt-copy-to" title="grunt-copy-to">grunt-copy-to</a></li> <li><a href="http://github.com/dylang/grunt-notify" title="grunt-notify">grunt-notify</a></li> <li><a href="http://github.com/SaschaGalley/grunt-phpcs" title="grunt-phpcs">grunt-phpcs</a></li> <li><a href="http://necolas.github.io/normalize.css/" title="normalize.css">normalize.css</a></li> <li><a href="http://github.com/fragphace/grunt-rm" title="grunt-rm">grunt-rm</a></li> <li><a href="http://github.com/sindresorhus/grunt-sass" title="grunt-sass">grunt-sass</a></li> <li><a href="http://code.google.com/p/html5shiv/" title="html5shiv">html5shiv</a></li> <li><a href="http://jquery.com/" title="JQuery">JQuery</a></li> <li><a href="http://blog.themeforest.net/site-news/building-better-template-documentation/" title="Themeforest documentation template">Themeforest documentation template</a></li> </ul> <hr> <p> Once again, thank you so much for purchasing this theme. As said at the beginning, we'd be glad to help you if you have any questions relating to this theme. No guarantees, but we'll do our best to assist. If you have a more general question relating to the themes on ThemeForest, you might consider visiting the forums and asking the question in the "Item Discussion" section. </p> <p class="append-bottom alt large"><strong><%= themeAuthor %></strong></p> <p><a href="#toc">Go To Table of Contents</a></p> <hr class="space"> </div><!-- end div .container --> </body> </html>