diff --git a/.babelrc b/.babelrc index 34c75dda2..758df2aeb 100644 --- a/.babelrc +++ b/.babelrc @@ -1,17 +1,4 @@ { - "plugins": [ - "transform-es2015-arrow-functions", - "transform-es2015-block-scoped-functions", - "transform-es2015-block-scoping", - "transform-es2015-classes", - "transform-es2015-destructuring", - "transform-es2015-template-literals", - "transform-es2015-parameters", - "transform-es2015-shorthand-properties", - "transform-es2015-spread", - ["transform-es2015-modules-commonjs", { - "allowTopLevelThis": true - }] - ], + "presets": ["es2015"], "compact": false -} \ No newline at end of file +} diff --git a/.bowerrc b/.bowerrc deleted file mode 100644 index e3343d296..000000000 --- a/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "assets/components" -} diff --git a/.gitignore b/.gitignore index d4fc935b6..ba51521f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,7 @@ .DS_Store +node_modules +npm-debug.log +dist *.sass-cache* *.log -node_modules/ -assets/stylesheets/ -assets/components/ -assets/javascript/vendor/ -assets/javascript/foundation.js -assets/javascript/custom/demosite.js -packaged/ -wpcs/ \ No newline at end of file +*.swp diff --git a/README.md b/README.md index 42f5ffd58..c3655e2b1 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ All contributions are welcome! ## Requirements -**This project requires [Node.js](http://nodejs.org) v4.x.x to v6.11.x to be installed on your machine.** Please be aware that you will most likely encounter problems with the installation if you are using the most current Node version (bleeding edge) with all the latest features. +**This project requires [Node.js](http://nodejs.org) v4.x.x to v6.11.x to be installed on your machine.** Please be aware that you might encounter problems with the installation if you are using the most current Node version (bleeding edge) with all the latest features. FoundationPress uses [Sass](http://Sass-lang.com/) (CSS with superpowers). In short, Sass is a CSS pre-processor that allows you to write styles more effectively and tidy. @@ -26,62 +26,55 @@ $ cd FoundationPress $ npm install ``` -### 2. While you're working on your project, run: +### 2. Get started -```bash -$ npm run watch -``` +For WordPress development on localhost, I recommend using [MAMP](https://www.mamp.info/en/) for Mac, [WAMP](http://www.wampserver.com/en/download-wampserver-64bits/) for Windows or [LAMP](https://www.linux.com/learn/easy-lamp-server-installation) for Linux. -If you want to take advantage of browser-sync (automatic browser refresh when a file is saved), simply open your Gulpfile.js and put your local dev-server address (e.g localhost) in this field ```var URL = '';``` , save the Gulpfile and run -```bash -$ npm run watch -``` +If you want to take advantage of browser-sync (automatic browser refresh when a file is saved), simply open your gulpfile.babel.js and put your local dev-server address and port (e.g http://localhost:8888) in the `URL` variable. -### 3. For building all the assets, run: +Then, simply run ```bash -$ npm run build +$ npm start ``` -Build all assets minified and without sourcemaps: -```bash -$ npm run production -``` +### 3. Compile assets for production -### 4. To create a .zip file of your theme, run: +When building for production, the CSS and JS will be minified. To minify the assets in your `/dist` folder, run ```bash -$ npm run package +$ npm run build ``` -Running this command will build and minify the theme's assets and place a `.zip` archive of the theme in the `packaged` directory. This excludes the developer files/directories from your theme like `node_modules`, `assets/components`, etc. to keep the theme lightweight for transferring the theme to a staging or production server. +### Project structure -### Styles +In the `/src` folder you will the working files for all your assets. Every time you make a change to a file that is watched by Gulp, the output will be saved to the `/dist` folder. The contents of this folder is the compiled code that you should not touch (unless you have a good reason for it). - * `style.css`: Do not worry about this file. (For some reason) it's required by WordPress. All styling are handled in the Sass files described below +The `/page-templates` folder contains templates that can be selected in the Pages section of the WordPress admin panel. To create a new page-template, simply create a new file in this folder and make sure to give it a template name. - * `assets/scss/foundation.scss`: Make imports for all your styles here - * `assets/scss/global/*.scss`: Global settings - * `assets/scss/components/*.scss`: Buttons etc. - * `assets/scss/modules/*.scss`: Topbar, footer etc. - * `assets/scss/templates/*.scss`: Page template spesific styling +I guess the rest is quite self explanatory. Feel free to ask if you feel stuck. -Please note that you **must** run `npm run build` or `npm run watch` in your terminal for the styles to be copied and concatenated. See the [Gulpfile.js](https://github.com/olefredrik/FoundationPress/blob/master/gulpfile.js) for details +### Styles and Sass Compilation + + * `style.css`: Do not worry about this file. (For some reason) it's required by WordPress. All styling are handled in the Sass files described below -### Scripts + * `src/assets/scss/app.scss`: Make imports for all your styles here + * `src/assets/scss/global/*.scss`: Global settings + * `src/assets/scss/components/*.scss`: Buttons etc. + * `src/assets/scss/modules/*.scss`: Topbar, footer etc. + * `src/assets/scss/templates/*.scss`: Page template styling -* `assets/javascript/custom`: This is the folder where you put all your custom scripts. Every .js file you put in this directory will be minified and concatenated one single .js file. (This is good for site speed and performance) + * `dist/assets/css/app.css`: This file is loaded in the `` section of your document, and contains the compiled styles for your project. -Please note that you must run `npm run build` or `npm run watch` in your terminal for the scripts to be copied and concatenated. See [Gulpfile.js](https://github.com/olefredrik/FoundationPress/blob/master/gulpfile.js) for details +If you're new to Sass, please note that you need to have Gulp running in the background (``npm start``), for any changes in your scss files to be compiled to `app.css`. -### The main styles and scripts generated by the build +### JavaScript Compilation -Version control on these files are turned off because they are automatically generated as part of the build process. +All JavaScript files in the `src/assets/js` folder, along ith Foundation and its dependencies, are bundled into one file called `app.js`. The files are imported using module dependency with [webpack](https://webpack.js.org/) as the module bundler. -* `assets/stylesheets/foundation.css`: All Sass files are minified and compiled to this file -* `assets/stylesheets/foundation.css.map`: CSS source maps +If you're unfamiliar with modules and module bundling, check out [this resource for node style require/exports](http://openmymind.net/2012/2/3/Node-Require-and-Exports/) and [this resource to understand ES6 modules](http://exploringjs.com/es6/ch_modules.html). -* `assets/javascript/vendor`: Vendor scripts are copied from `assets/components/` to this directory. We use this path for enqueing the vendor scripts in WordPress. +Foundation modules are loaded in the `src/assets/js/app.js` file. By default all components are loaded. You can also pick and choose which modules to include. Just follow the instructions in the file. ## Demo diff --git a/assets/fonts/FontAwesome.otf b/assets/fonts/FontAwesome.otf deleted file mode 100644 index 401ec0f36..000000000 Binary files a/assets/fonts/FontAwesome.otf and /dev/null differ diff --git a/assets/fonts/fontawesome-webfont.eot b/assets/fonts/fontawesome-webfont.eot deleted file mode 100644 index e9f60ca95..000000000 Binary files a/assets/fonts/fontawesome-webfont.eot and /dev/null differ diff --git a/assets/fonts/fontawesome-webfont.svg b/assets/fonts/fontawesome-webfont.svg deleted file mode 100644 index 855c845e5..000000000 --- a/assets/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,2671 +0,0 @@ - - - - -Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 - By ,,, -Copyright Dave Gandy 2016. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/fonts/fontawesome-webfont.ttf b/assets/fonts/fontawesome-webfont.ttf deleted file mode 100644 index 35acda2fa..000000000 Binary files a/assets/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/assets/fonts/fontawesome-webfont.woff b/assets/fonts/fontawesome-webfont.woff deleted file mode 100644 index 400014a4b..000000000 Binary files a/assets/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/assets/fonts/fontawesome-webfont.woff2 b/assets/fonts/fontawesome-webfont.woff2 deleted file mode 100644 index 4d13fc604..000000000 Binary files a/assets/fonts/fontawesome-webfont.woff2 and /dev/null differ diff --git a/assets/javascript/custom/init-foundation.js b/assets/javascript/custom/init-foundation.js deleted file mode 100644 index de0f51d52..000000000 --- a/assets/javascript/custom/init-foundation.js +++ /dev/null @@ -1 +0,0 @@ -jQuery(document).foundation(); diff --git a/assets/javascript/custom/stickyfooter.js b/assets/javascript/custom/stickyfooter.js deleted file mode 100644 index 701b13791..000000000 --- a/assets/javascript/custom/stickyfooter.js +++ /dev/null @@ -1,18 +0,0 @@ -/* Sticky Footer */ - -(function($) { - - var $footer = $('[data-sticky-footer]'); // only search once - - $(window).bind('load resize orientationChange', function () { - - var pos = $footer.position(), - height = ($(window).height() - pos.top) - ($footer.height() -1); - - if (height > 0) { - $footer.css('margin-top', height); - } - - }); - -})(jQuery); diff --git a/assets/scss/components/_cards.scss b/assets/scss/components/_cards.scss deleted file mode 100644 index c55254de3..000000000 --- a/assets/scss/components/_cards.scss +++ /dev/null @@ -1,29 +0,0 @@ -.flex-card-example { - @include breakpoint(small) { - display: flex; - flex-direction: column; - flex-wrap: wrap; - justify-content: space-between; - } - - @include breakpoint(medium) { - flex-direction: row; - } - - .card { - - @include breakpoint(small) { - width: 100%; - img { width: 100%; } - } - - @include breakpoint(medium) { - width: 32%; - } - - .card-content { - padding: 1rem; - } - - } -} diff --git a/assets/scss/global/_demosite-settings.scss b/assets/scss/global/_demosite-settings.scss deleted file mode 100644 index a2afd2063..000000000 --- a/assets/scss/global/_demosite-settings.scss +++ /dev/null @@ -1,10 +0,0 @@ -$dark-grey: #2c3840; -$body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; -$offcanvas-background: $dark-grey; -$titlebar-background: $dark-grey; -$titlebar-color: $white; -$titlebar-icon-color: $white; -$titlebar-icon-color-hover: $medium-gray; -$topbar-padding: 0; -$topbar-background: $dark-grey; -$topbar-submenu-background: $dark-grey; diff --git a/assets/scss/modules/_content.scss b/assets/scss/modules/_content.scss deleted file mode 100644 index b80a0d526..000000000 --- a/assets/scss/modules/_content.scss +++ /dev/null @@ -1,51 +0,0 @@ -.main-wrap { - @include grid-row(); - margin-top: 1rem; - - @include breakpoint(medium) { - margin-top: 3rem; - } -} - -.main-content { - - // default 2 column - @include grid-column(12); - @include breakpoint(medium) { - @include grid-column(8); - } - - // 1 column - .full-width.main-wrap & { - @include breakpoint(medium) { - @include grid-column(12); - } - } - - // 2 column sidebar left - .sidebar-left.main-wrap & { - @include breakpoint(medium) { - @include grid-column(8); - @include grid-col-pos(4); - } - } -} - -.sidebar { - - // default 2 column - @include grid-column(12); - @include breakpoint(medium) { - @include grid-column(4); - margin-top: 1rem; - } - - // 2 column sidebar left - .sidebar-left.main-wrap & { - @include breakpoint(medium) { - @include grid-column(4); - @include grid-col-pos(-8); - margin-top: 1rem; - } - } -} \ No newline at end of file diff --git a/bower.json b/bower.json deleted file mode 100644 index 928c2abd4..000000000 --- a/bower.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "foundationpress", - "main": [ - "assets/stylesheets/foundation.css", - "assets/javascript/foundation.js" - ], - "ignore": [], - "dependencies": { - "foundation-sites": "~6.3.0", - "motion-ui" : "~1.2.0", - "fontawesome": "~4.7.0" - } -} diff --git a/config.yml b/config.yml new file mode 100644 index 000000000..7b2ed4e97 --- /dev/null +++ b/config.yml @@ -0,0 +1,29 @@ +# Autoprefixer will make sure your CSS works with these browsers +COMPATIBILITY: + - "last 2 versions" + - "ie >= 9" + - "ios >= 7" + +# UnCSS will use these settings +UNCSS_OPTIONS: + html: + - "**/*.html" + ignore: + - !!js/regexp .foundation-mq + - !!js/regexp ^\.is-.* + +# Gulp will reference these paths when it copies files +PATHS: + # Path to dist folder + dist: "dist" + # Paths to static assets that aren't images, CSS, or JavaScript + assets: + - "src/assets/**/*" + - "!src/assets/{img,js,scss}/**/*" + # Paths to Sass libraries, which can then be loaded with @import + sass: + - "node_modules/foundation-sites/scss" + - "node_modules/motion-ui/src" + # Paths to JavaScript entry points for webpack to bundle modules + entries: + - "src/assets/js/app.js" diff --git a/footer.php b/footer.php index 277efc6fe..b4c95e821 100644 --- a/footer.php +++ b/footer.php @@ -22,8 +22,7 @@ - - + diff --git a/gulpfile.babel.js b/gulpfile.babel.js new file mode 100644 index 000000000..0df673765 --- /dev/null +++ b/gulpfile.babel.js @@ -0,0 +1,139 @@ +'use strict'; + +import plugins from 'gulp-load-plugins'; +import yargs from 'yargs'; +import browser from 'browser-sync'; +import gulp from 'gulp'; +import rimraf from 'rimraf'; +import yaml from 'js-yaml'; +import fs from 'fs'; +import webpackStream from 'webpack-stream'; +import webpack2 from 'webpack'; +import named from 'vinyl-named'; + +// Load all Gulp plugins into one variable +const $ = plugins(); + +// Check for --production flag +const PRODUCTION = !!(yargs.argv.production); + +// Load settings from settings.yml +const { COMPATIBILITY, UNCSS_OPTIONS, PATHS } = loadConfig(); + +function loadConfig() { + let ymlFile = fs.readFileSync('config.yml', 'utf8'); + return yaml.load(ymlFile); +} + +// Enter URL of your local server here +// Example: 'http://localhost:8888' +var URL = ''; + +// Build the "dist" folder by running all of the below tasks +gulp.task('build', + gulp.series(clean, sass, javascript, images, copy)); + +// Build the site, run the server, and watch for file changes +gulp.task('default', + gulp.series('build', server, watch)); + +// Delete the "dist" folder +// This happens every time a build starts +function clean(done) { + rimraf(PATHS.dist, done); +} + +// Copy files out of the assets folder +// This task skips over the "img", "js", and "scss" folders, which are parsed separately +function copy() { + return gulp.src(PATHS.assets) + .pipe(gulp.dest(PATHS.dist + '/assets')); +} + +// Compile Sass into CSS +// In production, the CSS is compressed +function sass() { + return gulp.src('src/assets/scss/app.scss') + .pipe($.sourcemaps.init()) + .pipe($.sass({ + includePaths: PATHS.sass + }) + .on('error', $.sass.logError)) + .pipe($.autoprefixer({ + browsers: COMPATIBILITY + })) + // Comment in the pipe below to run UnCSS in production + //.pipe($.if(PRODUCTION, $.uncss(UNCSS_OPTIONS))) + .pipe($.if(PRODUCTION, $.cleanCss({ compatibility: 'ie9' }))) + .pipe($.if(!PRODUCTION, $.sourcemaps.write())) + .pipe(gulp.dest(PATHS.dist + '/assets/css')) + .pipe(browser.reload({ stream: true })); +} + +let webpackConfig = { + module: { + rules: [ + { + test: /.js$/, + use: [ + { + loader: 'babel-loader' + } + ] + } + ] + } +} +// Combine JavaScript into one file +// In production, the file is minified +function javascript() { + return gulp.src(PATHS.entries) + .pipe(named()) + .pipe($.sourcemaps.init()) + .pipe(webpackStream(webpackConfig, webpack2)) + .pipe($.if(PRODUCTION, $.uglify() + .on('error', e => { console.log(e); }) + )) + .pipe($.if(!PRODUCTION, $.sourcemaps.write())) + .pipe(gulp.dest(PATHS.dist + '/assets/js')); +} + +// Copy images to the "dist" folder +// In production, the images are compressed +function images() { + return gulp.src('src/assets/img/**/*') + .pipe($.if(PRODUCTION, $.imagemin({ + progressive: true + }))) + .pipe(gulp.dest(PATHS.dist + '/assets/img')); +} + +// Start BrowserSync to preview the site in +function server(done) { + browser.init({ + proxy: URL, + + ui: { + port: 8080 + }, + + }); + done(); +} + +// Reload the browser with BrowserSync +function reload(done) { + browser.reload(); + done(); +} + + + +// Watch for changes to static assets, pages, Sass, and JavaScript +function watch() { + gulp.watch(PATHS.assets, copy); + gulp.watch('src/assets/scss/**/*.scss').on('all', sass); + gulp.watch('**/*.php').on('all', browser.reload); + gulp.watch('src/assets/js/**/*.js').on('all', gulp.series(javascript, browser.reload)); + gulp.watch('src/assets/img/**/*').on('all', gulp.series(images, browser.reload)); +} diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index ec3bf3a6a..000000000 --- a/gulpfile.js +++ /dev/null @@ -1,233 +0,0 @@ -/*jslint node: true */ -"use strict"; - -var $ = require('gulp-load-plugins')(); -var argv = require('yargs').argv; -var gulp = require('gulp'); -var browserSync = require('browser-sync').create(); -var merge = require('merge-stream'); -var sequence = require('run-sequence'); -var colors = require('colors'); -var dateFormat = require('dateformat'); -var del = require('del'); -var cleanCSS = require('gulp-clean-css'); - -// Enter URL of your local server here -// Example: 'http://localwebsite.dev' -var URL = ''; - -// Check for --production flag -var isProduction = !!(argv.production); - -// Browsers to target when prefixing CSS. -var COMPATIBILITY = [ - 'last 2 versions', - 'ie >= 9', - 'Android >= 2.3' -]; - -// File paths to various assets are defined here. -var PATHS = { - sass: [ - 'assets/components/foundation-sites/scss', - 'assets/components/motion-ui/src', - 'assets/components/fontawesome/scss', - ], - javascript: [ - 'assets/components/what-input/what-input.js', - 'assets/components/foundation-sites/js/foundation.core.js', - 'assets/components/foundation-sites/js/foundation.util.*.js', - - // Paths to individual JS components defined below - 'assets/components/foundation-sites/js/foundation.abide.js', - 'assets/components/foundation-sites/js/foundation.accordion.js', - 'assets/components/foundation-sites/js/foundation.accordionMenu.js', - 'assets/components/foundation-sites/js/foundation.drilldown.js', - 'assets/components/foundation-sites/js/foundation.dropdown.js', - 'assets/components/foundation-sites/js/foundation.dropdownMenu.js', - 'assets/components/foundation-sites/js/foundation.equalizer.js', - 'assets/components/foundation-sites/js/foundation.interchange.js', - 'assets/components/foundation-sites/js/foundation.magellan.js', - 'assets/components/foundation-sites/js/foundation.offcanvas.js', - 'assets/components/foundation-sites/js/foundation.orbit.js', - 'assets/components/foundation-sites/js/foundation.responsiveMenu.js', - 'assets/components/foundation-sites/js/foundation.responsiveToggle.js', - 'assets/components/foundation-sites/js/foundation.reveal.js', - 'assets/components/foundation-sites/js/foundation.slider.js', - 'assets/components/foundation-sites/js/foundation.sticky.js', - 'assets/components/foundation-sites/js/foundation.tabs.js', - 'assets/components/foundation-sites/js/foundation.toggler.js', - 'assets/components/foundation-sites/js/foundation.tooltip.js', - 'assets/components/foundation-sites/js/foundation.zf.responsiveAccordionTabs.js', - - - // Motion UI - 'assets/components/motion-ui/motion-ui.js', - - // Include your own custom scripts (located in the custom folder) - 'assets/javascript/custom/*.js', - ], - pkg: [ - '**/*', - '!**/node_modules/**', - '!**/components/**', - '!**/scss/**', - '!**/bower.json', - '!**/gulpfile.js', - '!**/package.json', - '!**/composer.json', - '!**/composer.lock', - '!**/codesniffer.ruleset.xml', - '!**/packaged/*', - ] -}; - -// Browsersync task -gulp.task('browser-sync', ['build'], function() { - - var files = [ - '**/*.php', - 'assets/images/**/*.{png,jpg,gif}', - ]; - - browserSync.init(files, { - // Proxy address - proxy: URL, - - // Port # - // port: PORT - }); -}); - -// Compile Sass into CSS -// In production, the CSS is compressed -gulp.task('sass', function() { - return gulp.src('assets/scss/foundation.scss') - .pipe($.sourcemaps.init()) - .pipe($.sass({ - includePaths: PATHS.sass - })) - .on('error', $.notify.onError({ - message: "<%= error.message %>", - title: "Sass Error" - })) - .pipe($.autoprefixer({ - browsers: COMPATIBILITY - })) - // Minify CSS if run with --production flag - .pipe($.if(isProduction, cleanCSS())) - .pipe($.if(!isProduction, $.sourcemaps.write('.'))) - .pipe(gulp.dest('assets/stylesheets')) - .pipe(browserSync.stream({match: '**/*.css'})); -}); - -// Lint all JS files in custom directory -gulp.task('lint', function() { - return gulp.src('assets/javascript/custom/*.js') - .pipe($.jshint()) - .pipe($.notify(function (file) { - if (file.jshint.success) { - return false; - } - - var errors = file.jshint.results.map(function (data) { - if (data.error) { - return "(" + data.error.line + ':' + data.error.character + ') ' + data.error.reason; - } - }).join("\n"); - return file.relative + " (" + file.jshint.results.length + " errors)\n" + errors; - })); -}); - -// Combine JavaScript into one file -// In production, the file is minified -gulp.task('javascript', function() { - var uglify = $.uglify() - .on('error', $.notify.onError({ - message: "<%= error.message %>", - title: "Uglify JS Error" - })); - - return gulp.src(PATHS.javascript) - .pipe($.sourcemaps.init()) - .pipe($.babel()) - .pipe($.concat('foundation.js', { - newLine:'\n;' - })) - .pipe($.if(isProduction, uglify)) - .pipe($.if(!isProduction, $.sourcemaps.write())) - .pipe(gulp.dest('assets/javascript')) - .pipe(browserSync.stream()); -}); - -// Copy task -gulp.task('copy', function() { - // Font Awesome - var fontAwesome = gulp.src('assets/components/fontawesome/fonts/**/*.*') - .pipe(gulp.dest('assets/fonts')); - - return merge(fontAwesome); -}); - -// Package task -gulp.task('package', ['build'], function() { - var fs = require('fs'); - var time = dateFormat(new Date(), "yyyy-mm-dd_HH-MM"); - var pkg = JSON.parse(fs.readFileSync('./package.json')); - var title = pkg.name + '_' + time + '.zip'; - - return gulp.src(PATHS.pkg) - .pipe($.zip(title)) - .pipe(gulp.dest('packaged')); -}); - -// Build task -// Runs copy then runs sass & javascript in parallel -gulp.task('build', ['clean'], function(done) { - sequence('copy', - ['sass', 'javascript', 'lint'], - done); -}); - -// Clean task -gulp.task('clean', function(done) { - sequence(['clean:javascript', 'clean:css'], - done); -}); - -// Clean JS -gulp.task('clean:javascript', function() { - return del([ - 'assets/javascript/foundation.js' - ]); -}); - -// Clean CSS -gulp.task('clean:css', function() { - return del([ - 'assets/stylesheets/foundation.css', - 'assets/stylesheets/foundation.css.map' - ]); -}); - -// Default gulp task -// Run build task and watch for file changes -gulp.task('default', ['build', 'browser-sync'], function() { - // Log file changes to console - function logFileChange(event) { - var fileName = require('path').relative(__dirname, event.path); - console.log('[' + 'WATCH'.green + '] ' + fileName.magenta + ' was ' + event.type + ', running tasks...'); - } - - // Sass Watch - gulp.watch(['assets/scss/**/*.scss'], ['clean:css', 'sass']) - .on('change', function(event) { - logFileChange(event); - }); - - // JS Watch - gulp.watch(['assets/javascript/custom/**/*.js'], ['clean:javascript', 'javascript', 'lint']) - .on('change', function(event) { - logFileChange(event); - }); -}); diff --git a/header.php b/header.php index e748aa43b..41eb93844 100644 --- a/header.php +++ b/header.php @@ -20,7 +20,6 @@ -
@@ -35,6 +34,7 @@
+ +
diff --git a/library/enqueue-scripts.php b/library/enqueue-scripts.php index 5319d09da..c76e37e53 100644 --- a/library/enqueue-scripts.php +++ b/library/enqueue-scripts.php @@ -13,17 +13,17 @@ function foundationpress_scripts() { // Enqueue the main Stylesheet. - wp_enqueue_style( 'main-stylesheet', get_template_directory_uri() . '/assets/stylesheets/foundation.css', array(), '2.9.3', 'all' ); + wp_enqueue_style( 'main-stylesheet', get_template_directory_uri() . '/dist/assets/css/app.css', array(), '2.10.0', 'all' ); - // Deregister the jquery version bundled with WordPress. + // Deregister the jquery version bundled with WordPress, as we're injecting the version we need with Webpack. wp_deregister_script( 'jquery' ); - // CDN hosted jQuery placed in the header, as some plugins require that jQuery is loaded in the header. - wp_enqueue_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js', array(), '2.1.0', false ); + // Enqueue Founation scripts + wp_enqueue_script( 'foundation', get_template_directory_uri() . '/dist/assets/js/app.js', array(), '2.10.0', true ); - // If you'd like to cherry-pick the foundation components you need in your project, head over to gulpfile.js and see lines 35-54. - // It's a good idea to do this, performance-wise. No need to load everything if you're just going to use the grid anyway, you know :) - wp_enqueue_script( 'foundation', get_template_directory_uri() . '/assets/javascript/foundation.js', array('jquery'), '2.9.3', true ); + // Enqueue FontAwesome from CDN. Uncomment the line below if you don't need FontAwesome. + wp_enqueue_script( 'jquery', 'https://use.fontawesome.com/5016a31c8c.js', array(), '4.7.0', true ); + // Add the comment-reply library on pages where it is necessary if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { diff --git a/library/foundation.php b/library/foundation.php index 151f78566..710f65579 100644 --- a/library/foundation.php +++ b/library/foundation.php @@ -62,11 +62,11 @@ function foundationpress_menu_fallback() { } endif; -// Add Foundation 'active' class for the current menu item. +// Add Foundation 'is-ctive' class for the current menu item. if ( ! function_exists( 'foundationpress_active_nav_class' ) ) : function foundationpress_active_nav_class( $classes, $item ) { if ( 1 === $item->current || true === $item->current_item_ancestor ) { - $classes[] = 'active'; + $classes[] = 'is-active'; } return $classes; } @@ -181,4 +181,3 @@ function foundationpress_title_bar_responsive_toggle() { } } endif; - diff --git a/package.json b/package.json index 51fd3429d..884d56804 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,16 @@ { "name": "foundationpress", "title": "FoundationPress", - "version": "2.9.3", + "version": "2.10.0", "description": "FoundationPress is a WordPress starter theme based on Foundation 6 by Zurb", + "license": "MIT", + "main": "gulpfile.js", + + "scripts": { + "start": "gulp", + "build": "gulp build --production" + }, + "keywords": [ "FoundationPress", "WordPress", @@ -13,62 +21,61 @@ "customizable", "responsive" ], - "homepage": "http://foundationpress.olefredrik.com/", - "bugs": "https://github.com/olefredrik/FoundationPress/issues", - "license": "MIT", - "main": "gulpfile.js", - "repository": { - "type": "git", - "url": "https://github.com/olefredrik/FoundationPress.git" + + "dependencies": { + "foundation-sites": "~6.4.1", + "jquery": "~3.0.0", + "what-input": "^4.1.3", + "motion-ui": "~1.2.2" }, + "devDependencies": { - "autoprefixer": "^6.1.0", - "babel-core": "^6.5.2", - "babel-plugin-transform-es2015-arrow-functions": "^6.3.13", - "babel-plugin-transform-es2015-block-scoped-functions": "^6.3.13", - "babel-plugin-transform-es2015-block-scoping": "^6.4.0", - "babel-plugin-transform-es2015-classes": "^6.3.15", - "babel-plugin-transform-es2015-destructuring": "^6.3.15", - "babel-plugin-transform-es2015-modules-commonjs": "^6.3.13", - "babel-plugin-transform-es2015-parameters": "^6.3.26", - "babel-plugin-transform-es2015-shorthand-properties": "^6.5.0", - "babel-plugin-transform-es2015-spread": "^6.4.0", - "babel-plugin-transform-es2015-template-literals": "^6.3.13", - "babel-preset-es2015": "^6.5.0", - "babel-register": "^6.5.2", - "bower": "^1.8.0", + "babel-core": "^6.24.1", + "babel-loader": "^6.4.1", + "babel-preset-es2015": "^6.3.13", + "babel-register": "^6.7.2", "browser-sync": "^2.10.0", - "colors": "^1.1.2", - "dateformat": "^1.0.12", - "del": "^2.2.0", - "gulp": "^3.9.0", + "gulp": "gulpjs/gulp#4.0", "gulp-autoprefixer": "^3.1.0", "gulp-babel": "^6.1.2", - "gulp-clean-css": "^3.7.0", - "gulp-concat": "^2.6.0", - "gulp-flatten": "^0.2.0", + "gulp-clean-css": "^3.3.1", + "gulp-cli": "^1.2.1", + "gulp-concat": "^2.5.2", + "gulp-extname": "^0.2.0", "gulp-if": "^2.0.0", - "gulp-jshint": "^2.0.0", + "gulp-imagemin": "^2.2.1", "gulp-load-plugins": "^1.1.0", - "gulp-notify": "^2.2.0", - "gulp-plumber": "^1.0.1", - "gulp-sass": "^3.1.0", - "gulp-sourcemaps": "^2.6.0", - "gulp-uglify": "^1.5.1", - "gulp-uncss": "^1.0.4", - "gulp-util": "^3.0.7", - "gulp-zip": "^3.0.2", - "jshint": "^2.8.0", - "merge-stream": "^1.0.0", - "motion-ui": "^1.1.0", - "run-sequence": "^1.1.5", - "yargs": "^3.31.0" + "gulp-sass": "^2.1.0", + "gulp-sourcemaps": "^1.6.0", + "gulp-uglify": "^1.2.0", + "gulp-uncss": "^1.0.1", + "js-yaml": "^3.4.6", + "panini": "^1.3.0", + "rimraf": "^2.4.3", + "style-sherpa": "^1.0.0", + "vinyl-named": "^1.1.0", + "webpack": "^2.6.1", + "webpack-stream": "^3.2.0", + "yargs": "^3.8.0" }, - "scripts": { - "build": "gulp build", - "package": "gulp package --production", - "postinstall": "bower install && gulp build", - "production": "gulp --production", - "watch": "gulp" + + "repository": { + "type": "git", + "url": "https://github.com/olefredrik/foundationpress.git" + }, + + "bugs": { + "url": "https://github.com/olefredrik/foundationpress/issues" + }, + + "homepage": { + "url": "https://foundationpress.olefredrik.com/" + }, + + "babel": { + "presets": [ + "es2015" + ] } + } diff --git a/page-templates/front.php b/page-templates/front.php index 3ccd0d929..28c5dfca2 100644 --- a/page-templates/front.php +++ b/page-templates/front.php @@ -13,12 +13,8 @@
-
- 1.5k stargazers -
- + 1.5k stargazers + @olefredrik
@@ -68,27 +64,27 @@
- semantic + semantic

Semantic

Everything is semantic. You can have the cleanest markup without sacrificing the utility and speed of Foundation.

- responsive + responsive

Responsive

You can build for small devices first. Then, as devices get larger and larger, layer in more complexity for a complete responsive design.

- customizable + customizable

Customizable

You can customize your build to include or remove certain elements, as well as define the size of columns, colors, font size and more.

- professional + professional

Professional

Millions of designers and developers depend on Foundation. We have business support, training and consulting to help grow your product or service.

diff --git a/page-templates/kitchen-sink.php b/page-templates/kitchen-sink.php index 9c84c1ff6..89423523e 100644 --- a/page-templates/kitchen-sink.php +++ b/page-templates/kitchen-sink.php @@ -21,92 +21,98 @@

Abide

+
- -
-
- -

Here's how you use this input field!

-
-
- -

This input is ignored by Abide using `data-abide-ignore`

-
-
- -

Enter a password please.

-
-
- -

This field is using the `data-equalto="password"` attribute, causing it to match the password field above.

-
-
-
-
- -
-
- -
-
-
-
- Choose Your Favorite, and this is required, so you have to pick one. - - - -
-
- Choose Your Favorite - not required, you can leave this one blank. - - - -
-
- Check these out - - - -
-
-
-
- -
-
- -
-
+
+
+ +
+
+
+
+ +

Here's how you use this input field!

+
+
+ +

This input is ignored by Abide using `data-abide-ignore`

+
+
+ +

Enter a password please.

+
+
+ +

This field is using the `data-equalto="password"` attribute, causing it to match the password field above.

+
+
+
+
+ +
+
+ +
+
+
+
+ Choose Your Favorite, and this is required, so you have to pick one. + + + +
+
+ Choose Your Favorite - not required, you can leave this one blank. + + + +
+
+ Check these out + + + +
+
+
+
+ +
+
+ +
+
+
@@ -257,76 +263,76 @@

Cards

-
+
- -
-

Dreams feel real

-

I'm going to improvise. Listen, there's something you should know about me... about inception.

- Last updated 1 minute ago + +
+

Dreams feel real

+

I'm going to improvise. Listen, there's something you should know about me... about inception.

+ Last updated 1 minute ago +
-
- -
-

Menus

-

Cards play nicely with menus too! Give them a try.

- + +
+

Menus

+

Cards play nicely with menus too! Give them a try.

+ +
-
-
-

Featured

-
-
-

Your title here!

-

An idea is like a virus, resilient, highly contagious. The smallest seed of an idea can grow. It can grow to define or destroy you.

+
+

Featured

+
+
+

Your title here!

+

An idea is like a virus, resilient, highly contagious. The smallest seed of an idea can grow. It can grow to define or destroy you.

+
-
-
- -
-

Buttons!

-

Who doesn't love a good button? Buttons work in all of their forms too.

- I'm a button +
+ +
+

Buttons!

+

Who doesn't love a good button? Buttons work in all of their forms too.

+ I'm a button +
-
-
- -
-

And button groups...

-

Button groups also work great!

-
- One - Two - Three -
+
+ +
+

And button groups...

+

Button groups also work great!

+
+ One + Two + Three +
+
-
-
-
-

Centered

-
+
+
+

Centered

+
-
-

The utility classes like .text-center work great too.

- Click me +
+

The utility classes like .text-center work great too.

+ Click me +
-
+

-

Close Button

@@ -433,6 +439,28 @@

+

Equalizer

+
+
+
+
+ +
+
+
+
+

Pellentesque habitant morbi tristique senectus et netus et, ante.

+
+
+
+
+ +
+
+
+
+
+

Flex Video

@@ -440,14 +468,6 @@

- -

Float Classes

-
- Left - Right -
-
-

Forms

@@ -489,15 +509,20 @@
+
+
- $ - - Submit + $ + +
+ +
+
@@ -774,45 +799,43 @@

Tabs

- +
-
-

One

-

Check me out! I'm a super cool Tab panel with text content! On medium-down screen sizes, this component will transform into an accordion.

-
-
-

Two

- -
-
-

Three

-

Check me out! I'm a super cool Tab panel with text content!

-
-
-

Four

- -
-
-

Five

-

Check me out! I'm a super cool Tab panel with text content!

-
-
-

Six

- -
- -
-
- +
+

One

+

Check me out! I'm a super cool Tab panel with text content! On medium-down screen sizes, this component will transform into an accordion.

+
+
+

Two

+ +
+
+

Three

+

Check me out! I'm a super cool Tab panel with text content!

+
+
+

Four

+ +
+
+

Five

+

Check me out! I'm a super cool Tab panel with text content!

+
+
+

Six

+ +
+
+

Thumbnail

@@ -939,8 +962,8 @@
  • Drilldown Menu
  • Dropdown Menu
  • Dropdown Pane
  • +
  • Equalizer
  • Flex Video
  • -
  • Float Classes
  • Forms
  • Grid
  • Label
  • diff --git a/assets/images/demo/customizable.svg b/src/assets/images/demo/customizable.svg similarity index 100% rename from assets/images/demo/customizable.svg rename to src/assets/images/demo/customizable.svg diff --git a/assets/images/demo/hero-bg-foundation-6-large.svg b/src/assets/images/demo/hero-bg-foundation-6-large.svg similarity index 100% rename from assets/images/demo/hero-bg-foundation-6-large.svg rename to src/assets/images/demo/hero-bg-foundation-6-large.svg diff --git a/assets/images/demo/hero-bg-foundation-6-small.svg b/src/assets/images/demo/hero-bg-foundation-6-small.svg similarity index 100% rename from assets/images/demo/hero-bg-foundation-6-small.svg rename to src/assets/images/demo/hero-bg-foundation-6-small.svg diff --git a/assets/images/demo/professional.svg b/src/assets/images/demo/professional.svg similarity index 100% rename from assets/images/demo/professional.svg rename to src/assets/images/demo/professional.svg diff --git a/assets/images/demo/responsive.svg b/src/assets/images/demo/responsive.svg similarity index 100% rename from assets/images/demo/responsive.svg rename to src/assets/images/demo/responsive.svg diff --git a/assets/images/demo/semantic.svg b/src/assets/images/demo/semantic.svg similarity index 100% rename from assets/images/demo/semantic.svg rename to src/assets/images/demo/semantic.svg diff --git a/assets/images/icons/apple-touch-icon-114x114.png b/src/assets/images/icons/apple-touch-icon-114x114.png similarity index 100% rename from assets/images/icons/apple-touch-icon-114x114.png rename to src/assets/images/icons/apple-touch-icon-114x114.png diff --git a/assets/images/icons/apple-touch-icon-144x144.png b/src/assets/images/icons/apple-touch-icon-144x144.png similarity index 100% rename from assets/images/icons/apple-touch-icon-144x144.png rename to src/assets/images/icons/apple-touch-icon-144x144.png diff --git a/assets/images/icons/apple-touch-icon-72x72.png b/src/assets/images/icons/apple-touch-icon-72x72.png similarity index 100% rename from assets/images/icons/apple-touch-icon-72x72.png rename to src/assets/images/icons/apple-touch-icon-72x72.png diff --git a/assets/images/icons/apple-touch-icon.png b/src/assets/images/icons/apple-touch-icon.png similarity index 100% rename from assets/images/icons/apple-touch-icon.png rename to src/assets/images/icons/apple-touch-icon.png diff --git a/assets/images/icons/favicon.ico b/src/assets/images/icons/favicon.ico similarity index 100% rename from assets/images/icons/favicon.ico rename to src/assets/images/icons/favicon.ico diff --git a/src/assets/js/app.js b/src/assets/js/app.js new file mode 100644 index 000000000..213c72765 --- /dev/null +++ b/src/assets/js/app.js @@ -0,0 +1,13 @@ +import $ from 'jquery'; +import whatInput from 'what-input'; + +window.$ = $; + +import Foundation from 'foundation-sites'; +// If you want to pick and choose which modules to include, comment out the above and uncomment +// the line below +//import './lib/foundation-explicit-pieces'; + +import './lib/demosite'; + +$(document).foundation(); diff --git a/src/assets/js/lib/demosite.js b/src/assets/js/lib/demosite.js new file mode 100644 index 000000000..c8ddb5ef6 --- /dev/null +++ b/src/assets/js/lib/demosite.js @@ -0,0 +1,12 @@ +import $ from 'jquery'; + +$.ajax({ + dataType: 'jsonp', + url: 'https://api.github.com/repos/olefredrik/foundationpress?callback=foundationpressGithub&access_token=ed6229228dbc763038dbf1e68d0d8a4a0935b38a', + success: function (response) { + if (response && response.data.watchers) { + var watchers = (Math.round((response.data.watchers / 100), 10) / 10).toFixed(1); + $('#stargazers a').html(watchers + 'k stargazers'); + } + } +}); diff --git a/src/assets/js/lib/foundation-explicit-pieces.js b/src/assets/js/lib/foundation-explicit-pieces.js new file mode 100644 index 000000000..4045c9983 --- /dev/null +++ b/src/assets/js/lib/foundation-explicit-pieces.js @@ -0,0 +1,103 @@ +import $ from 'jquery'; +import { Foundation } from 'foundation-sites/js/foundation.core'; +import { rtl, GetYoDigits, transitionend } from 'foundation-sites/js/foundation.util.core'; +import { Box } from 'foundation-sites/js/foundation.util.box' +import { onImagesLoaded } from 'foundation-sites/js/foundation.util.imageLoader'; +import { Keyboard } from 'foundation-sites/js/foundation.util.keyboard'; +import { MediaQuery } from 'foundation-sites/js/foundation.util.mediaQuery'; +import { Motion, Move } from 'foundation-sites/js/foundation.util.motion'; +import { Nest } from 'foundation-sites/js/foundation.util.nest'; +import { Timer } from 'foundation-sites/js/foundation.util.timer'; +import { Touch } from 'foundation-sites/js/foundation.util.touch'; +import { Triggers } from 'foundation-sites/js/foundation.util.triggers'; +import { Abide } from 'foundation-sites/js/foundation.abide'; +import { Accordion } from 'foundation-sites/js/foundation.accordion'; +import { AccordionMenu } from 'foundation-sites/js/foundation.accordionMenu'; +import { Drilldown } from 'foundation-sites/js/foundation.drilldown'; +import { Dropdown } from 'foundation-sites/js/foundation.dropdown'; +import { DropdownMenu } from 'foundation-sites/js/foundation.dropdownMenu'; +import { Equalizer } from 'foundation-sites/js/foundation.equalizer'; +import { Interchange } from 'foundation-sites/js/foundation.interchange'; +import { Magellan } from 'foundation-sites/js/foundation.magellan'; +import { OffCanvas } from 'foundation-sites/js/foundation.offcanvas'; +import { Orbit } from 'foundation-sites/js/foundation.orbit'; +import { ResponsiveMenu } from 'foundation-sites/js/foundation.responsiveMenu'; +import { ResponsiveToggle } from 'foundation-sites/js/foundation.responsiveToggle'; +import { Reveal } from 'foundation-sites/js/foundation.reveal'; +import { Slider } from 'foundation-sites/js/foundation.slider'; +import { SmoothScroll } from 'foundation-sites/js/foundation.smoothScroll'; +import { Sticky } from 'foundation-sites/js/foundation.sticky'; +import { Tabs } from 'foundation-sites/js/foundation.tabs'; +import { Toggler } from 'foundation-sites/js/foundation.toggler'; +import { Tooltip } from 'foundation-sites/js/foundation.tooltip'; +import { ResponsiveAccordionTabs } from 'foundation-sites/js/foundation.responsiveAccordionTabs'; + + +Foundation.addToJquery($); + +// Add Foundation Utils to Foundation global namespace for backwards +// compatibility. + +Foundation.rtl = rtl; +Foundation.GetYoDigits = GetYoDigits; +Foundation.transitionend = transitionend; + +Foundation.Box = Box; +Foundation.onImagesLoaded = onImagesLoaded; +Foundation.Keyboard = Keyboard; +Foundation.MediaQuery = MediaQuery; +Foundation.Motion = Motion; +Foundation.Move = Move; +Foundation.Nest = Nest; +Foundation.Timer = Timer; + +// Touch and Triggers previously were almost purely sede effect driven, +// so no // need to add it to Foundation, just init them. + +Touch.init($); + +Triggers.init($, Foundation); + +Foundation.plugin(Abide, 'Abide'); + +Foundation.plugin(Accordion, 'Accordion'); + +Foundation.plugin(AccordionMenu, 'AccordionMenu'); + +Foundation.plugin(Drilldown, 'Drilldown'); + +Foundation.plugin(Dropdown, 'Dropdown'); + +Foundation.plugin(DropdownMenu, 'DropdownMenu'); + +Foundation.plugin(Equalizer, 'Equalizer'); + +Foundation.plugin(Interchange, 'Interchange'); + +Foundation.plugin(Magellan, 'Magellan'); + +Foundation.plugin(OffCanvas, 'OffCanvas'); + +Foundation.plugin(Orbit, 'Orbit'); + +Foundation.plugin(ResponsiveMenu, 'ResponsiveMenu'); + +Foundation.plugin(ResponsiveToggle, 'ResponsiveToggle'); + +Foundation.plugin(Reveal, 'Reveal'); + +Foundation.plugin(Slider, 'Slider'); + +Foundation.plugin(SmoothScroll, 'SmoothScroll'); + +Foundation.plugin(Sticky, 'Sticky'); + +Foundation.plugin(Tabs, 'Tabs'); + +Foundation.plugin(Toggler, 'Toggler'); + +Foundation.plugin(Tooltip, 'Tooltip'); + +Foundation.plugin(ResponsiveAccordionTabs, 'ResponsiveAccordionTabs'); + +module.exports = Foundation; diff --git a/assets/scss/global/_settings.scss b/src/assets/scss/_settings.scss similarity index 66% rename from assets/scss/global/_settings.scss rename to src/assets/scss/_settings.scss index 8eb193e97..bb561dd5e 100644 --- a/assets/scss/global/_settings.scss +++ b/src/assets/scss/_settings.scss @@ -1,4 +1,5 @@ -// Foundation for Sites Settings +// FoundationPress settings. +// Based on Foundation v6.4.1 // ----------------------------- // // Table of Contents: @@ -21,27 +22,47 @@ // 16. Drilldown // 17. Dropdown // 18. Dropdown Menu -// 19. Forms -// 20. Label -// 21. Media Object -// 22. Menu -// 23. Meter -// 24. Off-canvas -// 25. Orbit -// 26. Pagination -// 27. Progress Bar -// 28. Responsive Embed -// 29. Reveal -// 30. Slider -// 31. Switch -// 32. Table -// 33. Tabs -// 34. Thumbnail -// 35. Title Bar -// 36. Tooltip -// 37. Top Bar - -@import '../../components/foundation-sites/scss/util/util'; +// 19. Flexbox Utilities +// 20. Forms +// 21. Label +// 22. Media Object +// 23. Menu +// 24. Meter +// 25. Off-canvas +// 26. Orbit +// 27. Pagination +// 28. Progress Bar +// 29. Prototype Arrow +// 30. Prototype Border-Box +// 31. Prototype Border-None +// 32. Prototype Bordered +// 33. Prototype Display +// 34. Prototype Font-Styling +// 35. Prototype List-Style-Type +// 36. Prototype Overflow +// 37. Prototype Position +// 38. Prototype Rounded +// 39. Prototype Separator +// 40. Prototype Shadow +// 41. Prototype Sizing +// 42. Prototype Spacing +// 43. Prototype Text-Decoration +// 44. Prototype Text-Transformation +// 45. Prototype Text-Utilities +// 46. Responsive Embed +// 47. Reveal +// 48. Slider +// 49. Switch +// 50. Table +// 51. Tabs +// 52. Thumbnail +// 53. Title Bar +// 54. Tooltip +// 55. Top Bar +// 56. Xy Grid + +@import 'util/util'; +@import 'global/colors'; // 1. Global // --------- @@ -63,15 +84,20 @@ $black: #0a0a0a; $white: #fefefe; $body-background: $white; $body-font-color: $black; -$body-font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; +$body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; $body-antialiased: true; $global-margin: 1rem; $global-padding: 1rem; +$global-position: 1rem; $global-weight-normal: normal; $global-weight-bold: bold; $global-radius: 0; +$global-menu-padding: 0.7rem 1rem; +$global-menu-nested-margin: 1rem; $global-text-direction: ltr; -$global-flexbox: false; +$global-flexbox: true; +$global-prototype-breakpoints: false; +$global-color-pick-contrast-tolerance: 0; $print-transparent-backgrounds: true; @include add-foundation-colors; @@ -99,6 +125,7 @@ $grid-column-gutter: ( medium: 30px, ); $grid-column-align-edge: true; +$grid-column-alias: 'columns'; $block-grid-max: 8; // 4. Base Typography @@ -210,8 +237,17 @@ $accordion-content-padding: 1rem; // 8. Accordion Menu // ----------------- +$accordionmenu-padding: $global-menu-padding; +$accordionmenu-nested-margin: $global-menu-nested-margin; +$accordionmenu-submenu-padding: $accordionmenu-padding; $accordionmenu-arrows: true; $accordionmenu-arrow-color: $primary-color; +$accordionmenu-item-background: null; +$accordionmenu-border: null; +$accordionmenu-submenu-toggle-background: null; +$accordion-submenu-toggle-border: $accordionmenu-border; +$accordionmenu-submenu-toggle-width: 40px; +$accordionmenu-submenu-toggle-height: $accordionmenu-submenu-toggle-width; $accordionmenu-arrow-size: 6px; // 9. Badge @@ -235,11 +271,15 @@ $breadcrumbs-item-color-current: $black; $breadcrumbs-item-color-disabled: $medium-gray; $breadcrumbs-item-margin: 0.75rem; $breadcrumbs-item-uppercase: true; -$breadcrumbs-item-slash: true; +$breadcrumbs-item-separator: true; +$breadcrumbs-item-separator-item: '/'; +$breadcrumbs-item-separator-item-rtl: '\\'; +$breadcrumbs-item-separator-color: $medium-gray; // 11. Button // ---------- +$button-font-family: inherit; $button-padding: 0.85em 1em; $button-margin: 0 0 $global-margin 0; $button-fill: solid; @@ -248,6 +288,7 @@ $button-background-hover: scale-color($button-background, $lightness: -15%); $button-color: $white; $button-color-alt: $black; $button-radius: $global-radius; +$button-hollow-border-width: 1px; $button-sizes: ( tiny: 0.6rem, small: 0.75rem, @@ -292,7 +333,7 @@ $card-border: 1px solid $light-gray; $card-shadow: none; $card-border-radius: $global-radius; $card-padding: $global-padding; -$card-margin: $global-margin; +$card-margin-bottom: $global-margin; // 15. Close Button // ---------------- @@ -319,9 +360,13 @@ $closebutton-color-hover: $black; $drilldown-transition: transform 0.15s linear; $drilldown-arrows: true; +$drilldown-padding: $global-menu-padding; +$drilldown-nested-margin: 0; +$drilldown-background: $white; +$drilldown-submenu-padding: $drilldown-padding; +$drilldown-submenu-background: $white; $drilldown-arrow-color: $primary-color; $drilldown-arrow-size: 6px; -$drilldown-background: $white; // 17. Dropdown // ------------ @@ -344,11 +389,24 @@ $dropdown-sizes: ( $dropdownmenu-arrows: true; $dropdownmenu-arrow-color: $anchor-color; $dropdownmenu-arrow-size: 6px; +$dropdownmenu-arrow-padding: 1.5rem; $dropdownmenu-min-width: 200px; $dropdownmenu-background: $white; +$dropdownmenu-submenu-background: $dropdownmenu-background; +$dropdownmenu-padding: $global-menu-padding; +$dropdownmenu-nested-margin: 0; +$dropdownmenu-submenu-padding: $dropdownmenu-padding; $dropdownmenu-border: 1px solid $medium-gray; +$dropdown-menu-item-color-active: $light-gray; +$dropdown-menu-item-background-active: transparent; + +// 19. Flexbox Utilities +// --------------------- -// 19. Forms +$flex-source-ordering-count: 6; +$flexbox-responsive-breakpoints: true; + +// 20. Forms // --------- $fieldset-border: 1px solid $medium-gray; @@ -375,11 +433,13 @@ $input-placeholder-color: $medium-gray; $input-font-family: inherit; $input-font-size: rem-calc(16); $input-font-weight: $global-weight-normal; +$input-line-height: $global-lineheight; $input-background: $white; $input-background-focus: $white; $input-background-disabled: $light-gray; $input-border: 1px solid $medium-gray; $input-border-focus: 1px solid $dark-gray; +$input-padding: $form-spacing / 2; $input-shadow: inset 0 1px 2px rgba($black, 0.1); $input-shadow-focus: 0 0 5px $medium-gray; $input-cursor-disabled: not-allowed; @@ -388,7 +448,7 @@ $input-number-spinners: true; $input-radius: $global-radius; $form-button-radius: $global-radius; -// 20. Label +// 21. Label // --------- $label-background: $primary-color; @@ -399,26 +459,28 @@ $label-font-size: 0.8rem; $label-padding: 0.33333rem 0.5rem; $label-radius: $global-radius; -// 21. Media Object +// 22. Media Object // ---------------- $mediaobject-margin-bottom: $global-margin; $mediaobject-section-padding: $global-padding; $mediaobject-image-width-stacked: 100%; -// 22. Menu +// 23. Menu // -------- $menu-margin: 0; -$menu-margin-nested: 1rem; -$menu-item-padding: 0.7rem 1rem; +$menu-nested-margin: $global-menu-nested-margin; +$menu-items-padding: $global-menu-padding; +$menu-simple-margin: 1rem; $menu-item-color-active: $white; $menu-item-background-active: get-color(primary); $menu-icon-spacing: 0.25rem; $menu-item-background-hover: $light-gray; -$menu-border: $light-gray; +$menu-state-back-compat: true; +$menu-centered-back-compat: true; -// 23. Meter +// 24. Meter // --------- $meter-height: 1rem; @@ -428,23 +490,26 @@ $meter-fill-good: $success-color; $meter-fill-medium: $warning-color; $meter-fill-bad: $alert-color; -// 24. Off-canvas +// 25. Off-canvas // -------------- $offcanvas-size: 250px; $offcanvas-vertical-size: 250px; -$offcanvas-background: $light-gray; +$offcanvas-background: $dark-nav-color; $offcanvas-shadow: 0 0 10px rgba($black, 0.7); -$offcanvas-push-zindex: 1; -$offcanvas-overlap-zindex: 10; -$offcanvas-reveal-zindex: 1; +$offcanvas-inner-shadow-size: 20px; +$offcanvas-inner-shadow-color: rgba($black, 0.25); +$offcanvas-overlay-zindex: 11; +$offcanvas-push-zindex: 12; +$offcanvas-overlap-zindex: 13; +$offcanvas-reveal-zindex: 12; $offcanvas-transition-length: 0.5s; $offcanvas-transition-timing: ease; $offcanvas-fixed-reveal: true; $offcanvas-exit-background: rgba($white, 0.25); $maincontent-class: 'off-canvas-content'; -// 25. Orbit +// 26. Orbit // --------- $orbit-bullet-background: $medium-gray; @@ -459,7 +524,7 @@ $orbit-control-background-hover: rgba($black, 0.5); $orbit-control-padding: 1rem; $orbit-control-zindex: 10; -// 26. Pagination +// 27. Pagination // -------------- $pagination-font-size: rem-calc(14); @@ -477,7 +542,7 @@ $pagination-mobile-items: false; $pagination-mobile-current-item: false; $pagination-arrows: true; -// 27. Progress Bar +// 28. Progress Bar // ---------------- $progress-height: 1rem; @@ -486,7 +551,168 @@ $progress-margin-bottom: $global-margin; $progress-meter-background: $primary-color; $progress-radius: $global-radius; -// 28. Responsive Embed +// 29. Prototype Arrow +// ------------------- + +$prototype-arrow-directions: ( + down, + up, + right, + left +); +$prototype-arrow-size: 0.4375rem; +$prototype-arrow-color: $black; + +// 30. Prototype Border-Box +// ------------------------ + +$prototype-border-box-breakpoints: $global-prototype-breakpoints; + +// 31. Prototype Border-None +// ------------------------- + +$prototype-border-none-breakpoints: $global-prototype-breakpoints; + +// 32. Prototype Bordered +// ---------------------- + +$prototype-bordered-breakpoints: $global-prototype-breakpoints; +$prototype-border-width: rem-calc(1); +$prototype-border-type: solid; +$prototype-border-color: $medium-gray; + +// 33. Prototype Display +// --------------------- + +$prototype-display-breakpoints: $global-prototype-breakpoints; +$prototype-display: ( + inline, + inline-block, + block, + table, + table-cell +); + +// 34. Prototype Font-Styling +// -------------------------- + +$prototype-font-breakpoints: $global-prototype-breakpoints; +$prototype-wide-letter-spacing: rem-calc(4); +$prototype-font-normal: $global-weight-normal; +$prototype-font-bold: $global-weight-bold; + +// 35. Prototype List-Style-Type +// ----------------------------- + +$prototype-list-breakpoints: $global-prototype-breakpoints; +$prototype-style-type-unordered: ( + disc, + circle, + square +); +$prototype-style-type-ordered: ( + decimal, + lower-alpha, + lower-latin, + lower-roman, + upper-alpha, + upper-latin, + upper-roman +); + +// 36. Prototype Overflow +// ---------------------- + +$prototype-overflow-breakpoints: $global-prototype-breakpoints; +$prototype-overflow: ( + visible, + hidden, + scroll +); + +// 37. Prototype Position +// ---------------------- + +$prototype-position-breakpoints: $global-prototype-breakpoints; +$prototype-position: ( + static, + relative, + absolute, + fixed +); +$prototype-position-z-index: 975; + +// 38. Prototype Rounded +// --------------------- + +$prototype-rounded-breakpoints: $global-prototype-breakpoints; +$prototype-border-radius: rem-calc(3); + +// 39. Prototype Separator +// ----------------------- + +$prototype-separator-breakpoints: $global-prototype-breakpoints; +$prototype-separator-align: center; +$prototype-separator-height: rem-calc(2); +$prototype-separator-width: 3rem; +$prototype-separator-background: $primary-color; +$prototype-separator-margin-top: $global-margin; + +// 40. Prototype Shadow +// -------------------- + +$prototype-shadow-breakpoints: $global-prototype-breakpoints; +$prototype-box-shadow: 0 2px 5px 0 rgba(0,0,0,.16), + 0 2px 10px 0 rgba(0,0,0,.12); + +// 41. Prototype Sizing +// -------------------- + +$prototype-sizing-breakpoints: $global-prototype-breakpoints; +$prototype-sizing: ( + width, + height +); +$prototype-sizes: ( + 25: 25%, + 50: 50%, + 75: 75%, + 100: 100% +); + +// 42. Prototype Spacing +// --------------------- + +$prototype-spacing-breakpoints: $global-prototype-breakpoints; +$prototype-spacers-count: 3; + +// 43. Prototype Text-Decoration +// ----------------------------- + +$prototype-decoration-breakpoints: $global-prototype-breakpoints; +$prototype-text-decoration: ( + overline, + underline, + line-through, +); + +// 44. Prototype Text-Transformation +// --------------------------------- + +$prototype-transformation-breakpoints: $global-prototype-breakpoints; +$prototype-text-transformation: ( + lowercase, + uppercase, + capitalize +); + +// 45. Prototype Text-Utilities +// ---------------------------- + +$prototype-utilities-breakpoints: $global-prototype-breakpoints; +$prototype-text-overflow: ellipsis; + +// 46. Responsive Embed // -------------------- $responsive-embed-margin-bottom: rem-calc(16); @@ -495,7 +721,7 @@ $responsive-embed-ratios: ( widescreen: 16 by 9, ); -// 29. Reveal +// 47. Reveal // ---------- $reveal-background: $white; @@ -507,7 +733,7 @@ $reveal-radius: $global-radius; $reveal-zindex: 1005; $reveal-overlay-background: rgba($black, 0.45); -// 30. Slider +// 48. Slider // ---------- $slider-width-vertical: 0.5rem; @@ -521,7 +747,7 @@ $slider-handle-background: $primary-color; $slider-opacity-disabled: 0.25; $slider-radius: $global-radius; -// 31. Switch +// 49. Switch // ---------- $switch-background: $medium-gray; @@ -537,7 +763,7 @@ $switch-paddle-offset: 0.25rem; $switch-paddle-radius: $global-radius; $switch-paddle-transition: all 0.25s ease-out; -// 32. Table +// 50. Table // --------- $table-background: $white; @@ -557,8 +783,9 @@ $table-foot-row-hover: darken($table-foot-background, $table-hover-scale); $table-head-font-color: $body-font-color; $table-foot-font-color: $body-font-color; $show-header-for-stacked: false; +$table-stack-breakpoint: medium; -// 33. Tabs +// 51. Tabs // -------- $tab-margin: 0; @@ -575,7 +802,7 @@ $tab-content-border: $light-gray; $tab-content-color: $body-font-color; $tab-content-padding: 1rem; -// 34. Thumbnail +// 52. Thumbnail // ------------- $thumbnail-border: solid 4px $white; @@ -585,36 +812,53 @@ $thumbnail-shadow-hover: 0 0 6px 1px rgba($primary-color, 0.5); $thumbnail-transition: box-shadow 200ms ease-out; $thumbnail-radius: $global-radius; -// 35. Title Bar +// 53. Title Bar // ------------- -$titlebar-background: $light-gray; -$titlebar-color: $body-font-color; +$titlebar-background: $dark-nav-color; +$titlebar-color: $white; $titlebar-padding: 0.5rem; $titlebar-text-font-weight: bold; -$titlebar-icon-color: $body-font-color; -$titlebar-icon-color-hover: $black; +$titlebar-icon-color: $white; +$titlebar-icon-color-hover: $medium-gray; $titlebar-icon-spacing: 0.25rem; -// 36. Tooltip +// 54. Tooltip // ----------- +$has-tip-cursor: help; $has-tip-font-weight: $global-weight-bold; $has-tip-border-bottom: dotted 1px $dark-gray; $tooltip-background-color: $black; $tooltip-color: $white; $tooltip-padding: 0.75rem; +$tooltip-max-width: 10rem; $tooltip-font-size: $small-font-size; $tooltip-pip-width: 0.75rem; $tooltip-pip-height: $tooltip-pip-width * 0.866; $tooltip-radius: $global-radius; -// 37. Top Bar +// 55. Top Bar // ----------- -$topbar-padding: 0.5rem; -$topbar-background: $light-gray; +$topbar-padding: 0rem; +$topbar-background: $dark-nav-color; $topbar-submenu-background: $topbar-background; $topbar-title-spacing: 0.5rem 1rem 0.5rem 0; $topbar-input-width: 200px; $topbar-unstack-breakpoint: medium; + +// 56. Xy Grid +// ----------- + +$xy-grid: true; +$grid-container: $global-width; +$grid-columns: 12; +$grid-margin-gutters: ( + small: 20px, + medium: 30px +); +$grid-padding-gutters: $grid-margin-gutters; +$grid-container-padding: $grid-padding-gutters; +$grid-container-max: $global-width; +$block-grid-max: 8; diff --git a/assets/scss/foundation.scss b/src/assets/scss/app.scss similarity index 62% rename from assets/scss/foundation.scss rename to src/assets/scss/app.scss index 0dc47be6f..24e615f1d 100644 --- a/assets/scss/foundation.scss +++ b/src/assets/scss/app.scss @@ -1,42 +1,18 @@ -/* - Foundation for Sites components: - Import the building blocks you need for your project. - Reducing the number of imported components will optimize page speed. - --------------------------------------------------------------------- - The Foundation framework is built by Zurb - Licensed under MIT Open Source -*/ - - -// Settings -@import "global/settings"; // Foundation settings file. -@import "global/demosite-settings"; // These settings are only used for the demosite. Feel free to remove. - -// Foundation mixins & browser resets -@import '../components/foundation-sites/scss/foundation'; - - -// WP overrides -@import "global/wp-admin"; // Fix issues with wp-admin bar positioning -@import "global/wp-overrides"; // Override the default WordPress styling for some elements -@import "global/accessibility"; +@charset 'utf-8'; -// Third-party libraries -@import 'font-awesome'; +@import 'settings'; +@import 'foundation'; @import 'motion-ui'; - -// Foundation global styles @include foundation-global-styles; - - -// Individual foundation components @include foundation-grid; -// @include foundation-flex-grid; +@include foundation-flex-grid; +@include foundation-xy-grid-classes; @include foundation-typography; -@include foundation-forms; @include foundation-button; +@include foundation-forms; +// @include foundation-range-input; @include foundation-accordion; @include foundation-accordion-menu; @include foundation-badge; @@ -68,10 +44,11 @@ @include foundation-tooltip; @include foundation-top-bar; @include foundation-visibility-classes; -@include foundation-float-classes; -// @include foundation-flex-classes; +// @include foundation-float-classes; +@include foundation-flex-classes; + +// @include foundation-prototype-classes; -// Motion UI @include motion-ui-transitions; @include motion-ui-animations; @@ -80,6 +57,12 @@ Add your scss files below to structure your project styles */ +// Glboal +@import "global/_accessibility"; +@import "global/colors"; +@import "global/wp-admin"; +@import "global/wp-overrides"; + // Modules @import "modules/navigation"; @import "modules/content"; diff --git a/assets/scss/components/_buttons.scss b/src/assets/scss/components/_buttons.scss similarity index 82% rename from assets/scss/components/_buttons.scss rename to src/assets/scss/components/_buttons.scss index 421bbdee7..e8379ae36 100644 --- a/assets/scss/components/_buttons.scss +++ b/src/assets/scss/components/_buttons.scss @@ -1,5 +1,5 @@ .sites-button { - background: #FF6908; + background: $primary-color; font-size: 1.25rem; font-weight: bold; box-shadow: 0 -2px 0 rgba(0,0,0,0.2) inset; diff --git a/src/assets/scss/components/_cards.scss b/src/assets/scss/components/_cards.scss new file mode 100644 index 000000000..ba61bb026 --- /dev/null +++ b/src/assets/scss/components/_cards.scss @@ -0,0 +1,21 @@ +.cards-container { + + @include xy-grid; + + .card { + @include breakpoint(small) { + @include xy-cell(12); + + .card-content { + padding: 1rem; + } + + } + + @include breakpoint(medium) { + @include xy-cell(1 of 3, true, 0.7rem ); + + } + + } +} diff --git a/assets/scss/components/_dividers.scss b/src/assets/scss/components/_dividers.scss similarity index 100% rename from assets/scss/components/_dividers.scss rename to src/assets/scss/components/_dividers.scss diff --git a/assets/scss/components/_featured-image.scss b/src/assets/scss/components/_featured-image.scss similarity index 100% rename from assets/scss/components/_featured-image.scss rename to src/assets/scss/components/_featured-image.scss diff --git a/assets/scss/components/_links.scss b/src/assets/scss/components/_links.scss similarity index 100% rename from assets/scss/components/_links.scss rename to src/assets/scss/components/_links.scss diff --git a/assets/scss/global/_accessibility.scss b/src/assets/scss/global/_accessibility.scss similarity index 100% rename from assets/scss/global/_accessibility.scss rename to src/assets/scss/global/_accessibility.scss diff --git a/src/assets/scss/global/_colors.scss b/src/assets/scss/global/_colors.scss new file mode 100644 index 000000000..591a66915 --- /dev/null +++ b/src/assets/scss/global/_colors.scss @@ -0,0 +1 @@ +$dark-nav-color: #2C3840; diff --git a/assets/scss/global/_wp-admin.scss b/src/assets/scss/global/_wp-admin.scss similarity index 100% rename from assets/scss/global/_wp-admin.scss rename to src/assets/scss/global/_wp-admin.scss diff --git a/assets/scss/global/_wp-overrides.scss b/src/assets/scss/global/_wp-overrides.scss similarity index 100% rename from assets/scss/global/_wp-overrides.scss rename to src/assets/scss/global/_wp-overrides.scss diff --git a/src/assets/scss/modules/_content.scss b/src/assets/scss/modules/_content.scss new file mode 100644 index 000000000..d48b87887 --- /dev/null +++ b/src/assets/scss/modules/_content.scss @@ -0,0 +1,57 @@ +.main-wrap { + @include xy-grid-container; + @include xy-grid(); + margin-top: 1rem; + + @include breakpoint(medium) { + margin-top: 3rem; + } + + &.sidebar-left { + + // Place the sidebar below main content on small screens ... + @include breakpoint(small) { + .main-content { order: 1; } + .sidebar { order: 2; } + } + + // ... and to the left on medium-up screens, when using the sidebar-left template + @include breakpoint(medium) { + .main-content { order: 2; } + .sidebar { order: 1; } + } + } + + // Full width template + &.full-width { + .main-content { + @include xy-cell(12); + } + } + + .main-content { + + // Default template + @include breakpoint(small) { + @include xy-cell(12); + } + + @include breakpoint(medium) { + @include xy-cell(8); + } + + } + + .sidebar { + + @include breakpoint(small) { + @include xy-cell(12); + } + + @include breakpoint(medium) { + @include xy-cell(4); + margin-top: 1rem; + } + + } +} diff --git a/assets/scss/modules/_editor-style.scss b/src/assets/scss/modules/_editor-style.scss similarity index 100% rename from assets/scss/modules/_editor-style.scss rename to src/assets/scss/modules/_editor-style.scss diff --git a/assets/scss/modules/_footer.scss b/src/assets/scss/modules/_footer.scss similarity index 91% rename from assets/scss/modules/_footer.scss rename to src/assets/scss/modules/_footer.scss index 028d85740..38637b177 100644 --- a/assets/scss/modules/_footer.scss +++ b/src/assets/scss/modules/_footer.scss @@ -7,7 +7,7 @@ } .footer { - @include grid-row(); + @include xy-grid; padding: rem-calc(30) 0; ul { @@ -15,4 +15,4 @@ margin: 0; padding: 0; } -} \ No newline at end of file +} diff --git a/assets/scss/modules/_navigation.scss b/src/assets/scss/modules/_navigation.scss similarity index 96% rename from assets/scss/modules/_navigation.scss rename to src/assets/scss/modules/_navigation.scss index 35820b9ca..0372681c5 100644 --- a/assets/scss/modules/_navigation.scss +++ b/src/assets/scss/modules/_navigation.scss @@ -9,19 +9,11 @@ @include show-for(medium); } - - // Site title -.site-mobile-title a { - // placeholder -} - .site-desktop-title a { font-weight: bold; } - - // Mobile menu .mobile-menu { display: none; // prevents repaint caused by JS hiding menu onload @@ -47,8 +39,6 @@ } } - - // Tablet and desktop menu .desktop-menu { @@ -82,4 +72,4 @@ .nav-next { float:right; -} \ No newline at end of file +} diff --git a/assets/scss/templates/_demosite.scss b/src/assets/scss/templates/_demosite.scss similarity index 88% rename from assets/scss/templates/_demosite.scss rename to src/assets/scss/templates/_demosite.scss index a83a67b13..4d929f8b5 100644 --- a/assets/scss/templates/_demosite.scss +++ b/src/assets/scss/templates/_demosite.scss @@ -27,7 +27,7 @@ } } - .menu .active > a { background-color: lighten($dark-grey, 10%); } + .menu .active > a { background-color: #ccc; } } @@ -41,6 +41,12 @@ // Tablet and desktop menu .top-bar { + //background-color: #2C3840; + + ul { + //background-color: #2C3840; + } + .top-bar-title a { font-size: 1rem; color: #B9B9B9; @@ -61,7 +67,7 @@ } } - .menu .active > a { background-color: lighten($dark-grey, 10%); } + .menu .active > a { background-color: #ccc; } .menu>li:not(.menu-text)>a { padding: 1rem; } .menu li:not(:last-child) { border-right: 1px solid #4e4e4e; } diff --git a/assets/scss/templates/_front.scss b/src/assets/scss/templates/_front.scss similarity index 80% rename from assets/scss/templates/_front.scss rename to src/assets/scss/templates/_front.scss index 382b2b430..f9316c9f3 100644 --- a/assets/scss/templates/_front.scss +++ b/src/assets/scss/templates/_front.scss @@ -1,8 +1,8 @@ // Page header .front-hero { .marketing { - @include grid-row(); - max-width: 55rem; + @include xy-grid-container(55rem); + @include xy-grid; } @include breakpoint(small) { @@ -26,17 +26,11 @@ .watch { @include breakpoint(small) { - @include grid-column(7); - @include grid-column-position(-5); + @include xy-cell(7); } @include breakpoint(medium) { - @include grid-column(12); - @include grid-column-position(0); - } - - section { - display: inline; + @include xy-cell(12); } a { @@ -50,7 +44,7 @@ color: #fff; } - .stargazers { + #stargazers { :before { content: "\f09b"; font-family: FontAwesome; @@ -62,7 +56,7 @@ } } - .twitter { + #twitter { :before { content: "\f099"; font-family: FontAwesome; @@ -78,11 +72,11 @@ .tagline { @include breakpoint(small) { - @include grid-column(8); + @include xy-cell(8); } @include breakpoint(medium) { - @include grid-column(5); + @include xy-cell(5); padding-top: 6rem; } } @@ -113,16 +107,17 @@ // Intro .intro { - @include grid-row(); + @include xy-grid-container; + @include xy-grid; .fp-intro { @include breakpoint(small) { - @include grid-column(12); + @include xy-cell(12); } @include breakpoint(medium) { - @include grid-column(10); - @include grid-column-offset(1); + @include xy-cell(10); + @include xy-cell-offset(1); h2 { font-weight: 300; @@ -141,23 +136,24 @@ // Section divider .section-divider { - @include grid-row(); + @include xy-grid-container; + @include xy-grid; hr { - @include grid-column(12); + @include xy-cell(12); @extend .dotted; box-sizing: border-box; } } - // Benefits .benefits { - @include grid-row(); + @include xy-grid-container; + @include xy-grid; text-align: center; header { - @include grid-column(12); + @include xy-cell(12); h2 { font-weight: 300; @@ -175,11 +171,11 @@ .customizable, .professional { @include breakpoint(small) { - @include grid-column(12); + @include xy-cell(12); } @include breakpoint(medium) { - @include grid-column(3); + @include xy-cell(3); } img { @@ -199,8 +195,7 @@ } .why-foundation { - @include grid-row(); - @include grid-column(12); + @include xy-cell(12); margin-top: 4rem; } } diff --git a/assets/scss/templates/_kitchen-sink.scss b/src/assets/scss/templates/_kitchen-sink.scss similarity index 91% rename from assets/scss/templates/_kitchen-sink.scss rename to src/assets/scss/templates/_kitchen-sink.scss index f9f5f6503..068f025ca 100644 --- a/assets/scss/templates/_kitchen-sink.scss +++ b/src/assets/scss/templates/_kitchen-sink.scss @@ -1,5 +1,5 @@ .kitchen-sink-header { - @include grid-column(12); + @include xy-cell(12); } @@ -9,11 +9,11 @@ } @include breakpoint(small) { - @include grid-column(12); + @include xy-cell(12); } @include breakpoint(large) { - @include grid-column(9); + @include xy-cell(9); } } @@ -23,7 +23,7 @@ } @include breakpoint(large) { - @include grid-column(3); + @include xy-cell(3); display: block; float: right; @@ -76,4 +76,4 @@ .columns:nth-child(2), .columns.small-centered, .columns.large-centered { background: #e1e1e1; } -} \ No newline at end of file +} diff --git a/style.css b/style.css index e6cdc5c66..72c7d9915 100644 --- a/style.css +++ b/style.css @@ -3,7 +3,7 @@ Theme Name: FoundationPress Theme URI: http://foundationpress.olefredrik.com Github Theme URI: https://github.com/olefredrik/FoundationPress Description: FoundationPress is a WordPress starter theme based on Foundation 6 by Zurb -Version: 2.9.3 +Version: 2.10.0 Author: Ole Fredrik Lie Author URI: http://olefredrik.com/ diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 000000000..8ac66a35b --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,5 @@ +module.exports = { + externals: { + jquery: 'jQuery' + }, +};