Giter VIP home page Giter VIP logo

digitoimistodude / air-light Goto Github PK

View Code? Open in Web Editor NEW
933.0 29.0 143.0 40.91 MB

💨 WordPress starter theme - designed to be minimal, ultra-lightweight (< 20 kB) and easy for all kinds of WordPress projects. 7+years/1000+hours of development and still updating daily! We prefer the original WordPress way of doing things so no strange templating languages or frameworks here.

Home Page: https://airwptheme.com

License: MIT License

PHP 29.51% JavaScript 29.52% CSS 0.61% Shell 9.78% SCSS 30.60%
wordpress-theme wordpress-development wordpress-starter-theme wordpress lightweight sass accessible navigation development-theme accessibility-ready one-column

air-light's Introduction

Air-light - A minimalist WordPress starter theme

GitHub release GitHub contributors Build Status for PHP 8.3 Build Status for HTML Build Status for JS Build Status for CSS Build Status for PHP

Air-light (or simply Air) is designed to be an ultra minimal starting point for a WordPress project at Digitoimisto Dude Oy, a Finnish boutique digital agency in the center of Jyväskylä. Theme is originally based on _s. We welcome all happy contributors with open arms! See roadmap.

  • CSS gzipped: 16.8 KB (originally 124.4 KB)
  • JS gzipped: 8.6 KB (28.6 KB original)
  • Front page HTML: 7.4 KB (29.4 KB original)

air-light-readme-mockup-latest

Weekly updates!

This theme is constantly kept up to date by a bunch of awesome contributors. Wanna join in development? Read the instructions for contributing and let us know about your first PR!

Alt

Mission & vision

Air-light is built to be very straightforward, backwards compatible, front-end developer friendly and modular by its structure. Following Underscores and WordPress Theme Coding Standards best practices and most of the changes in _s are implemented as soon as they are committed.

Our mission and goal is minimalism and simplicity. Our vision is to build a theme that will not implement its own wrappers or functions, will not use any templating languages that would take things further from traditional PHP or CSS, will contain nothing that people will not use or need. Air-light will be free of weird "app-like" folder structures or odd syntaxes that nobody else uses. We love WordPress as it was and as it is.

Air was renamed to air-light in version 3.7.8 (March 20th, 2018), because air was already taken in the official WordPress theme directory.

Official, approved, accessibility-ready!

Air-light v. 4.2.2 was approved to official WordPress theme directory on June 4, 2018. But please note, all changes you do to the theme without generating your own or changing textdomain will be overridden in theme updates - so if you use this theme as a starting point, please follow instructions and/or replace the textdomain with your own.

Table of contents

  1. Usage
  2. Please note before using
  3. License
  4. Features
    1. Layout base & grid
    2. Typography
    3. Development
    4. Navigation
    5. WordPress & functions
    6. Custom Post Types
    7. Custom Taxonomies
    8. Namespaced PHP
    9. Accessibility
    10. Lazy load
    11. Disabled features
  5. Extra building blocks
    1. Sticky navigation
    2. WooCommerce support
  6. Requirements
  7. Recommendations for development
  8. How to build a new theme
  9. Contributing
    1. Air development
    2. Debuggers
      1. For Gulp
      2. For your editor
    3. Releasing a new version (staff only)
  10. Notes

Please note before using

Air is a development theme, so it has updates very often. By using this starter theme, you agree that anything can change to a different direction without a warning when you look at this dev-git the next time. Please note this theme has no updates inside WordPress by design. Use this theme to hack it to pieces and create your new awesome theme based on Air! Please also see Debuggers!

Air is not meant to be "a theme for everyone", which means it doesn't have all the parts that are generally included in multi-purpose themes for non-technical people (please see Disabled features).

If you want to use this theme as starter for your new theme, please note the theme won't necessarily be that much fun or won't look good by default and needs work from you. We recommend using Sage if you need something more extended.

License

Air is licensed with The MIT License (MIT) which means you can freely use this theme commercially or privately, modify it, or distribute it, but you are forbidden to hold Dude liable for anything, or claim that what you do with this is made by us.

Theme structure

We try to follow traditional WordPress Template Hierarchy as much as possible. This way we will provide a low threshold for junior developers and go hand in hand with official WordPress Theme Coding Standards.

Please see Visual Overview if you are interested in how the WordPress theme structure works.

Features

Some features, WooCommerce support and personal preferences of Dude are moved to Air helper plugin.

Layout base & grid

  • Gutenberg-ready
  • Flexbox-ready
  • CSS Grid-ready
  • SVG-ready
  • SASS-support (SCSS-syntax)
  • CSS reset from sanitize.css
  • Section blocks and containers
  • Basic and minimal CSS framework for forms, commenting and typography

Typography

  • Responsive typography with viewport units with fallbacks, see more in sass/layout/_typography.scss and sass/base/_helpers.scss, default syntax is @include responsive-font($font-size-min, $font-size-max); (formerly Megatype, still recommended with blogs or text-only based sites, but not included by default after 1.5.0)
  • Web fonts file are preferred, helper included: Sass Boilerplate's fontFace-mixin. Put files in fonts/ directory, you'll need .odt, .ttf, .woff, .woff2. Then just @include fontFace('Proxima Nova', '../../fonts/proximanova-regular-webfont', 400); in _typography.scss.

Development

  • BrowserSync for keeping multiple browsers and devices synchronized while testing, along with injecting updated CSS and JS into your browser while you're developing (included in devpackages)
  • gulp build script that compiles both Less and Sass, checks for JavaScript errors, optimizes images, and concatenates and minifies files (see Dude's devpackages)
  • npm for front-end package management

Navigation

  • Dependency-free, all in Vanilla JS
  • Custom navigation walker built accessibility in mind
  • Fully accessible
  • Full keyboard navigation support
  • Arrow navigation support
  • WCAG 2.0 AA compliant: Dropdowns close when pressing Esc while hovering
  • Supports multi-level drop down submenus
  • Supports animations
  • Hover-intent support
  • Focus trap for mobile navigation
  • Accessible burger menu
  • Easy to customize

WordPress & functions

  • Available for translation, full Polylang Pro support
  • Support for Post Thumbnails on posts and pages
  • Gutenberg support
  • HTML5 core markup for WordPress elements
  • Air specific: Hero template, section blocks

Custom Post Types

Air-light can register your CPT:s automatically.

  1. Add your custom post type to theme settings under post_types, located in functions.php like this:
'post_types' => [
  'Your_Post_Type'
]
  1. Add a file inc/post-types/your-post-type.php
  2. Extend Post_Type class with Your_Post_Type and define your post type in a public function called register(). See the example: inc/post-types/your-post-type.php.

Custom Taxonomies

Air-light can register your Taxonomies automatically.

  1. Add your taxonomy to theme settings under taxonomies, located in functions.php like this:
'taxonomies' => [
  'Your_Taxonomy' => [ 'post', 'page', 'your-post-type' ]
]
  1. Add a file inc/taxonomies/your-taxonomy.php
  2. Extend Taxonomy class with Your_Taxonomy and define your taxonomy in a public function called register(). See the example: inc/taxonomies/your-taxonomy.php.

Namespaced PHP

Air-light uses namespaced PHP since 5.0.0. This means that we no longer need to prefix functions and hooks, because namespace Air_Light; takes care of that.

When old function format was:

// Pre_get_posts
add_action( 'pre_get_posts', 'dude_pre_get_posts' );
function dude_pre_get_posts( $query ) {
  // Do something
}

New format goes like this:

// Pre_get_posts
add_action( 'pre_get_posts', __NAMESPACE__ . '\pre_get_posts' );
function pre_get_posts( $query ) {
  // Do something
}

Accessibility

Creating accessible websites is really important and our goal is to make air as accessible-ready as possible. Theme fully supports navigating with keyboard and screen-readers. Other accessible features:

Lazy load

From 4.7.1 air-light has a lazy loading image features for background images and imgs. If you don't use this feature, remove it from scripts. This feature depends on air-helper, check out the documentation in air-helper for further instructions.

Disabled features

  • Widgets
  • Post formats
  • Jetpack support
  • (Threaded) comments
  • Underscores Template tags
  • Sidebar

Javascript

Structure

All .js files in /js/src/* is built to production bundles in /js/prod/ folder and development bundles in /js/dev/ folder with the same name and loaded corresponding to the WP_ENV environment variable. The production scripts can be loaded on development by using ?load_production_builds URL parameter. The main scripts file loaded in front end is /js/src/front-end.js.

If you want to add a piece of custom JS, create a file under /js/src/modules/ and import or require it in /js/src/front-end.js. If you need a admin-specific JS, add a /js/src/admin.js and then enqueue /js/dist/admin.js with enqueue_admin_scripts

Legacy support

Our build uses babel to translate scripts to ES2015 compatible JS, so you can use modern JS syntax without thinking about backwards compatibility. There is a /js/src/legacy.js file, which contains the needed polyfills for browsers not supporting the ES2015 syntax and is automatically loaded on the header when such browser is detected.

Linter

We use Airbnb es-lint presets spiced up with our own flavors.

Extra building blocks

Sticky navigation

Air has a sticky navigation baked in.

How to enable

You can enable the sticky navigation by uncommenting navSticky() in the js/src/front-end.js file.

WooCommerce support

Air had by default a basic WooCommerce support from version 1.9.2, and for a while it was been separated to its own repository, air-woocommerce since v2.5.6.

How to enable

Starting from v2.6.0 WooCommerce support comes with Air helper plugin and Air contains optional very basic WC styles. Air helper will add it's WC functionality when theme support for WooCommerce is added. To enable:

  1. Get Air helper
  2. Activate the plugin

Requirements

  • PHP >= 8.3
  • Requires at least: WordPress 4.7.1
  • Tested up to WordPress 6.5.4

Recommendations for development

  • macOS
  • Devpackages - Npm and Gulp + plugins
  • Dudestack - A toolkit for creating a new professional WordPress project with deployments. Heavily based on Bedrock by Roots.

How to build a new theme

Please refer to Wiki section Getting started in theming with Air-light.

Usage

See Documentation.

Contributing

If you have ideas about the theme or spot an issue, please let us know. Before contributing ideas or reporting an issue about "missing" features or things regarding to the nature of that matter, please read Please note section. Thank you very much.

If you want to contribute to the development, please follow these instructions:

  1. Create a fork of this repository (or new branch if you have editor/maintainer permissions)
  2. Make your changes
  3. Create a pull request

Air development

Installation

If you want to improve air, you have two options.

1. Use dudestack

Air is originally built on dudestack. Install our development environment with these steps (unix only, sorry Windows!):

  1. mkdir -p /var/www && cd /var/www/ && git clone https://github.com/digitoimistodude/dudestack
  2. Go to bin folder cd /var/www/dudestack/bin and run bash wsl.sh or bash macos.sh depending on your platform. Follow instructions.
  3. Run createproject, name project after airdev when asked
  4. Wait for the project to be created (get a coffee, first time can take couple of minutes)
  5. Create a fork of air-light (press fork button on GitHub) (or if you are Dude staff, just create new branch for changes)
  6. Go to the themes folder of your WordPress instance via Terminal (cd /var/www/airdev/content/themes)
  7. Clone your fork with git clone [email protected]:yourusername/air-light.git (replace yourusername with your actual username)
  8. Cd to your new cloned repository cd /var/www/airdev/content/themes/air-light
  9. Add devDependencies to package.json from here
  10. Install the dependencies by running npm install inside the theme folder (if you don't have npm installed, see here or just use homebrew)
  11. Wait npm to get through files (get another cup of coffee)
  12. Activate theme - if you are using the lightweight macos-lemp-setup: cd /var/www/airdev && vendor/wp-cli/wp-cli/bin/wp theme activate air-light
  13. Open whole project to your preferred coding editor, for example when using Visual Studio Code that would be code /var/www/airdev/content/themes/air-light or via GUI (Open folder).
  14. Go to back to air-light dir with cd /var/www/airdev/content/themes/air-light and then run gulp and start developing! Please note, contributing to this theme is only possible when gulp is run from theme directory, NOT on project root.

You may want to add alias wp='./vendor/wp-cli/wp-cli/bin/wp' for macos-lemp-setup to be able to run WP-CLI with just wp.

2. Use your own stack

To install air-light to your own development environment, just clone your fork to your theme directory, activate the theme, and make changes. If you make changes to front-end (JS/SCSS), you'll need to use our gulpfile and npm dependencies, so make sure you go through steps 9-10 and 12 above.

When you make changes, commit them with clear describing commit messages and them make a pull request. We are happy to accept improvements!

Content and unit tests

Next you just need to add content and menu via airdev.test/admin, or you can use the ready-made content:

  1. cd ~/Projects/airdev
  2. wp plugin install wordpress-importer --activate
  3. wget https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml
  4. wp import theme-unit-test-data.xml --authors=create

Debuggers

Air-light comes with PHP_CodeSniffer for PHP files, stylelint for SCSS/CSS files and eslint for JS files built inside gulpfile.js. Please note, you need to configure global versions of these separately!

It's also recommended to use Query Monitor plugin, as some debugging messages goes straight to it's logger.

For gulp

PHP_CodeSniffer needs to be installed under /usr/local/bin/phpcs with WordPress-Coding-Standards for php-debuggers to work properly in gulp. If you don't want to use phpcs with gulp, you can disable it by commenting out or deleting line gulp.watch(phpSrc, ['phpcs']);.

The golden rule here is to make sure the commands stylelint, eslint and phpcs work from command line.

How to install PHP_CodeSniffer with WordPress Coding Standards for Gulp

This tutorial is based on the official instructions in WordPress-Coding-Standards and can be found also in our Internal handbook How to install the latest PHP_CodeSniffers with latest WordPress-Coding-Standards (private)

First, remove the old phpcs installation if you have one:

sudo rm /usr/local/bin/phpcs

Then go to home (not really yet, just on your command line, lol):

cd $HOME

Then, install phpcs + WPCS via composer:

composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer global require --dev wp-coding-standards/wpcs:"^3.0"

Symlink globally:

sudo ln -s $HOME/.composer/vendor/bin/phpcs /usr/local/bin/phpcs
sudo chmod +x /usr/local/bin/phpcs

Get PHPCompatibility package:

composer global require --dev phpcompatibility/php-compatibility:"*"

Test it works:

phpcs -i

Output should read:

The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, PHPCompatibility, Modernize, NormalizedArrays, Universal, PHPCSUtils, WordPress, WordPress-Core, WordPress-Docs and WordPress-Extra

Check that other linters work: stylelint -v, eslint -v

For your editor

It's also best to have all stylelint, eslint, phpcs living inside your editor. We think Visual Studio Code is best for this, check out the plugins inside vscode-settings repository to make sure everything is installed.

Releasing a new version (staff only)

This release cycle will release a new version to:

Whenever you have updates that are worthwhile, commit them with clear commit messages and then do versioning. Every meaningful commit or bunch of commits that form a feature together make the version go up semantically 0.0.1.

Use bash alias (replace YOURUSERNAME with your own):

alias release_new_air_version='git push && git push --tags && rsync -av -e ssh --exclude={"/node_modules/*","/bin/*","/sass/*"} /var/www/airdev/content/themes/air-light/* YOURUSERNAME@YOURSERVER:/var/www/airwptheme.com/public_html/demo/content/themes/air-light/ && /var/www/airdev/content/themes/air-light/bin && sh air-move-out.sh && sh air-pack.sh'

The release cycle:

  1. Commit your changes or merge a pull request
  2. Search and replace version in style.css, functions.php, package.json, readme.txt, CHANGELOG.md. Remember update Tested up WordPress version as well.
  3. Add a tag with git tag -a x.x.x commands, add the same description than in CHANGELOG.md
  4. Run release_new_air_version (this will move dotfiles etc. out, take care of packing and will give the URL for uploading to WordPress.org)
  5. Follow script instructions (do a theme check and upload the theme)
  6. Run sh air-move-in.sh. This will move dev-version back and restore the git functionality.

That's it, you released a new version!

Notes

Gzip file sizes tested with wc -c css/prod/global.css and gzip -c css/prod/global.css | wc -c commands.

Theme developers please note: if you use phpcs in SublimeLinter as custom standard on dudestack, you will need extra content/themes/air-light subfolders inside the theme directory for it to work on both global projects and with air-light.

Known issues

See tool related issues in devpackages and air-light issue tracker.

air-light's People

Contributors

codesolutions avatar dependabot[bot] avatar divn avatar dylanelliott27 avatar eliaskau avatar henriavoketo avatar jukra avatar michaelbourne avatar niq1982 avatar raikasdev avatar ronilaukkarinen avatar szepeviktor avatar timiwahalahti avatar tumppex avatar xandercalvert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

air-light's Issues

Where is whatinput

Where is whatinput.js? I see it gets compiled to all.js, but in order to recompile, do we need to include it ourselves?

ACF not working in frontpage

I use acf block in gutenberg with method acf_register_block
In admin page all workin but in front page the_content return empty block with content acf
I check wordpress method the_content

function the_content( $more_link_text = null, $strip_teaser = false ) {
	$content = get_the_content( $more_link_text, $strip_teaser );

//ACF data exist

	$content = apply_filters( 'the_content', $content );

// ACF data don't exist

	$content = str_replace( ']]>', ']]&gt;', $content );
	echo $content;
}

The problem exists only in your theme

Get rid of template-parts/content-*.php files

We should get rid of template-parts/content-*.php files because we don't use those in projects. Instead, we should add content-modular.php to the theme as it is used in every project.

Missing default image

Since the version 6.5.0 images folder seem to have been missing and thus the theme setting default_featured_image do not work. We probably should still have some default image in the theme, even we change it in every project.

Future plans, roadmap, etc

Hey everyone,

Just curious what you had in the books for major updates. I'm a fan of Air as a starter theme, but there are a number of ways I alter it with every use. Largely, I use Gutenberg heavily and not ACF, so I add better support for blocks and Gutenberg styles, as well as a new gulp process to make editor styles (so editing a page looks as close as possible to the live view). I also add search capabilities to all sites with a small accessible dialog js library for the search modal. Some other obscure things like prefers-color-scheme support and css variables instead of scss variables. Other css changes..

Mostly curious where your trajectory is taking you with all the new WP changes coming out, with the heavy reliance on Gutenberg, moving to full site editing and reducing the need for the customizer, and the overall goal of making themes be presentation only.

If any of your plans overlap with some of the changes I currently make, I could start sending some PRs your way. I don't want to introduce any breaking changes though since this is your starter theme.

Feel free to email me if you'd prefer to talk about this over email.

External-link.js: If link contains img, get alt tag content to aria-label

For example:

<a href="https://www.google.com">
  <img src="https://www.google.fi/images/branding/googlelogo/2x/googlelogo_color_160x56dp.png" alt="Google" />
</a>

This is currently outputting as:

<a href="https://www.google.com" aria-label="External site: " class="is-external-link">
  <img src="https://www.google.fi/images/branding/googlelogo/2x/googlelogo_color_160x56dp.png" alt="Google" />
</a>

It should be like this:

<a href="https://www.google.com" aria-label="External site: Google" class="is-external-link">
  <img src="https://www.google.fi/images/branding/googlelogo/2x/googlelogo_color_160x56dp.png" alt="Google" />
</a>

If there's target="_blank", it should be:

<a href="https://www.google.com" aria-label="External site: Google, opens in a new window" class="is-external-link" target="_blank">
  <img src="https://www.google.fi/images/branding/googlelogo/2x/googlelogo_color_160x56dp.png" alt="Google" />
</a>

Changes needed in external-link.js for it to be able to recognize the link type and parse the alt.

Theme Settings not observed

The first thing I noticed is the logo in the branding header wasnt working. My quick fix was to replace THEME_SETTINGS['logo'] with a string but I notice that the Gutenburg is active on pages when the theme setting is like 'use_classic_editor' => [ 'page' ], so it would appear that the THEME_SETTINGS are not effective.

The context is deploying to a new server. I copied the files up. Do I still have to do an npm install on the server? I don't know what else is different between that and my local and staging sites - where I never saw this problem

Any ideas?

Gutenberg styles are not loading up properly

After version 6-ish refactoring Gutenberg admin editor styles are not loading up properly in WordPress 5.6+.

Steps to reproduce:

  1. Install latest air-light theme
  2. Go to Articles and edit/add some
  3. See that there is no custom webfonts (Inter) etc and width is not as defined 800px. See that no styles from gutenberg.css gets loaded.

Somehow setup_editor_styles() function never gets triggered.

It works fine though when you add this quick hook to inc/hooks/gutenberg.php:

// Add backend styles for Gutenberg.
add_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\gutenberg_editor_assets' );

function gutenberg_editor_assets() {
  // Load the theme styles within Gutenberg.
  wp_enqueue_style( 'my-gutenberg-editor-styles', get_theme_file_uri( get_asset_file( 'gutenberg.css' ) ), false ); // phpcs:ignore
}

Perhaps @Niq1982 might know what's up with that.

style lint reserved word error on gulp watch?

Just installed a new test environment to look at the recent changes to the theme, and after npm installing and find/replacing the namespace (air-light) i attempted to run my first gulp watch and received this error that i haven't run into before. Curious if this is a new bug or an issue you may be aware of and have some advice on?

`
gulp watch ~
/themes/air-light/node_modules/stylelint/node_modules/cosmiconfig/dist/Explorer.js:54
for await (const place of this.config.searchPlaces) {
^^^^^

SyntaxError: Unexpected reserved word
at new Script (vm.js:51:7)
at createScript (vm.js:138:10)
at Object.runInThisContext (vm.js:199:10)
at Module._compile (module.js:624:28)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)

`

Should we replace namespace Air_Light; in replaces script

I've been asked many times why Air_Light namespace is not being replaced. Should we add it to replaces.

Why not:

  • No special need for it
  • It's a "fingerprint" of Air_Light theme
  • It's unique and not accidentally the same than other namespaces possible used, if any

Why replace:

  • To be consistent with other replaces like textdomain, screenreadertext-functions, etc.
  • Starter theme mentality - starter stuff should not be visible after creating a new theme
  • Why not replace it? No big reasons why not?
  • Anything else?

Keyboard support fix on mobile menu

On small screens, tabbing after the last link, will return back to the close button – which is great.

However, if your last link contains a submenu button, tabbing after it will not return focus on the close button. Instead, it will focus on the content behind the opened mobile menu.

Issue with registering custom post types

Hi!

I'm developing with air-light using Local by Flywheel. I'm also using devpackages. No problems so far. However:

Issue

I've followed the instructions for registering custom post types. I added your-post-type.php under inc/post-types. I uncommented the code in functions.php:

'post_types' => [ 'your-post-type' => 'Your_Post_Type', ],

Wordpress crashes and I am greeted with the error:

Fatal error: Class 'Air_Light\Post_Type' not found in /app/public/wp-content/themes/mycustomtheme/inc/post-types/your-post-type.php on line 16

Is this error caused by my development environment, or is there a step that I am missing? I have been trying to troubleshoot this problem without success.

Thank you for the great theme, any help at all is greatly appreciated!

Rebuild style structure to support modular structures like Gutenberg blocks

I'd like to move the base styles like headings, fonts, buttons and form fields to mixins. That way it would be a lot easier to keep the styles consistent in different kind of modules and blocks and rewrite Gutenberg block styles to match theme styles.

Example:

body .wp-block-file {
  .wp-block-file__button {
    @include button;
  }
}

Blockquote flowing out of viewport

I noticed on the demo site that the content of the <blockquote> element is flowing out of the viewport on smaller screens. Apparently it inherits width: 100% from .gutenberg-content > *, but it has a left margin of 2rem.

screenshot-20210220-195944

Setting width: auto on .gutenberg-content > blockquote seems to fix the issue (right padding might need additional adjusting though).

screenshot-20210220-200001

Screenshots taken in Firefox 85.0.1 on macOS Big Sur 11.2.

Sorry, got no setup ready to send a PR these days, but I hope the note is valuable. Great job with the theme!

CSS

Should be more clear and efficient for the users..Let's make more attractive interface

Change all color variables to native CSS vars except mixin parameters

Working with "color theme" and variation based sites more and more so there's really a need for color variables to be in CSS var format instead of SCSS ones. I have experimented with this here while workin on dark mode (here).

Only scenarios they are not suitable for are

  • Mixins
  • Functions
  • SCSS format of rgba colors

In functions and mixins we will use SCSS var as base and then convert them to CSS variables so we need to define those colors only once. For rgba colors we will need to have two variables which will be be easier with hexToRGB() mixin (example here).

If it's okay for everyone I'll implement this soon enough.

use_classic_editor not allowing null without error

Recently pulled the latest and started setting things up and noted by default that 'page' was set in the use_classic_editor function. Upon removing it, i noted an error flash whenever loading a page in the backend.

https://www.dropbox.com/s/4tkn08lkbutsrbh/Screen%20Shot%202020-12-10%20at%2010.23.49%20PM.png?dl=0

// If you want to use classic editor somewhere, define it here
'use_classic_editor' => [ 'page' ],

is there a recommended way to disable this without re-writing much of the gutenberg sub-functions?

Trying to add WP default taxonomy to custom post type

I'm really sorry if that's a general WP question and not air-light specific one - I'll promise not to overuse your support.

I managed to create a custom post type, but when I try to enable the WP default category taxonomy by updating the $args to 'taxonomies' => ['category'],it doesn't really work.

Can you please advice me how to add default category option to custom post type?

Deprecated stylefmt dependency in gulp-stylefmt

Stylefmt has a known bug that causes stylefmt not to run (too old stylelint version). The bug is in effect if other than stylelint-config-primer is used. Air switched to stylelint-config-wordpress after 4.3.1 so this bug exists.

Steps to fix in this issue. This won't be fixed until stylefmt is updated to the repo, but adding this issue as a note to myself.

➜  air-light (master) gulp watch
[10:47:01] Using gulpfile ~/Projects/airdev/content/themes/air-light/gulpfile.js
[10:47:01] Starting 'browsersync'...
[10:47:01] Finished 'browsersync' after 14 ms
[10:47:01] Starting 'watch'...
[10:47:01] Finished 'watch' after 26 ms
[Browsersync] Proxying: http://airdev.test
[Browsersync] Access URLs:
 --------------------------------------
       Local: http://localhost:3002
    External: http://192.168.1.233:3002
 --------------------------------------
          UI: http://localhost:3003
 UI External: http://localhost:3003
 --------------------------------------
[Browsersync] Watching files...
[10:47:20] Starting 'styles'...
[10:47:20] Finished 'styles' after 20 ms
[clean-css] Original size: 149271 bytes
[clean-css] Minified size: 114521 bytes
[clean-css] Time spent on minification: 751 ms
[clean-css] Compression efficiency: 23.279806526384895 %
[Browsersync] 1 file changed (global.min.css)
Error: Undefined rule font-family-no-missing-generic-family-keyword
    at module.exports (/Users/rolle/Projects/airdev/content/themes/air-light/node_modules/gulp-stylefmt/node_modules/stylelint/lib/utils/configurationError.js:8:27)
    at Object.keys.forEach.ruleName (/Users/rolle/Projects/airdev/content/themes/air-light/node_modules/gulp-stylefmt/node_modules/stylelint/lib/augmentConfig.js:279:13)
    at Array.forEach (<anonymous>)
    at normalizeAllRuleSettings (/Users/rolle/Projects/airdev/content/themes/air-light/node_modules/gulp-stylefmt/node_modules/stylelint/lib/augmentConfig.js:275:29)
    at augmentConfigBasic.then.then.then.then.augmentedConfig (/Users/rolle/Projects/airdev/content/themes/air-light/node_modules/gulp-stylefmt/node_modules/stylelint/lib/augmentConfig.js:84:12)
[Browsersync] 1 file changed (global.css)

PHPCS disable or ignore

Gulp is crashing out for me whenever it can't validate via PHPCS, and or some reason no matter what i do i can't get PHPCS to install globally for VSCODE or otherwise - so at this point i'm looking for an option to just disable PHPCS altogether since i'm not concerned about it in the first place. Thanks guys!

`
[15:50:32] Starting 'phpcs'...
[Browsersync] Reloading Browsers... (buffered 2 events)
[15:50:32] 'phpcs' errored after 393 ms
[15:50:32] Error in plugin "gulp-phpcs"
Message:
Cannot find "/usr/local/bin/phpcs"
Details:
domainEmitter: [object Object]
domainThrown: false

[15:50:32] 'watch' errored after 17 s
`

404 for gutenberg.css

Hi,

My editor is delivering a 404 for the following, there is no guternberg.css in the directory.

Screen Shot 2021-05-08 at 10 20 29 am

/Users/thomasparkes/Downloads/air-light-master 3/inc/hooks/gutenberg.php:
   82  
   83    // Enqueue editor styles.
   84:   add_editor_style( get_theme_file_uri( get_asset_file( 'gutenberg.css' ) ) );
   85  }
   86  

Add aria-attributes to nav-walker

nav-walker.php

For accessibility purposes:
$atts['aria-current'] = $item->current ? 'page' : '';

For security:

 //$atts['rel']    = ! empty( $item->xfn ) ? $item->xfn : '';
      if ( '_blank' === $item->target && empty( $item->xfn ) ) {
				$atts['rel'] = 'noopener noreferrer';
			} else {
				$atts['rel'] = $item->xfn;
			}

Gutenberg

Missing blocks

      'core/button', //need this to add buttons inline
      'core/group',
      'core/media-text',
      'core/block',
      'core/template',

Deprecated blocks

//'core/subhead', https://developer.wordpress.org/block-editor/how-to-guides/backward-compatibility/deprecations/#3-9-0
//'core/textColumns', https://developer.wordpress.org/block-editor/how-to-guides/backward-compatibility/deprecations/#3-5-0

Lastly, missing styles for alignwide and alignfull https://www.billerickson.net/full-and-wide-alignment-in-gutenberg/

@supports not compiling into CSS

Hi bros,

I've been a fan of Air for a while now and while playing with the current version I've noticed that @supports was not compiling into css. Turned out it was because of gulp-merge-media-queries. Just letting you know (or maybe it's just me).

Also, quick question: is there a specific reason why you mixed SASS variables with CSS ones?

Cheers!

Improve the development and workflow on Local by Flywheel and alike with devpackages

Moi!

I've been researching WP theme starters that include gulp/scss/browser-sync and are compatible with Gutenberg. So, I was really excited to test out air-light!

Issue

When I update my scss files, I don't think they are not being piped through properly. They don't appear in the live browsersync, and I don't see my changes in css/dev/global.css. I haven't been able to isolate the cause yet. I'm not sure how to best troubleshoot this, so I guess I'm asking for troubleshooting advice! Has anyone else had this issue? Perhaps there a step that I missed that would explicitly cause this issue?

If it helps, I'm using Local by Flywheel and VS Code.

Feedback
I ran into a few questions/comments in the setup process that I'd like to clarify for future users ~

  1. When changing file names, I got a bit confused at first when I saw 'air-light' and 'Air-light' mentioned, but not 'Air_light'. When things weren't working for me, I tried changing 'Air_light' to my theme name and it broke everything lol. Perhaps this could be helpful to clarify in the readme?

  2. When downloading devpackages, it includes a package.json file in addition to the one from air-light. Is there a process you recommend for merging them? I just manually compared and merged them (which is maybe what caused me problems).

  3. In the instructions for devpackages, it was a bit unclear to me if I was supposed to add the folder 'devpackages' to the root or the files within the 'devpackages' folder to the root. I think you used language like 'extract into root' and 'add to your project folder', but that still felt a bit unclear to me.

  4. There's a missing step for setting up browsersync ~ In gulp/config.js, if people aren't using dudestack, they will probably need to change the browsersync proxy settings.

Kiitos!! I hope that this feedback is helpful.

Best of luck!

Too wide replace command in the start script

Just noticed newtheme.sh uses grep -rl air * which searches also node_modules. This causes performance issues especially on WSL. Let's limit depth and improve this to theme files only. PRs accepted.

CSS Source Maps

Hi, css source maps do not seem to be created.
How can i enable them?
Thanks!

git pull new changes to my custom theme

Looks like many updates are made to this starter theme, even multiple releases in a day!

If I'm developing my own custom theme using air-light, and want to pull in the latest updates is there a sound process for this? I understand there would eventually be merge conflicts and would have to manually scan through the changes.

Container does not get height when placing divs inside of it and using Jeet grid

If I put divs inside of an container element, and assign them with Jeet markup col(x/y), the container will be height of 0(+paddings). If I simply give container a float:left, then the height kicks in, but centering wont work.

Here's my html and css

HTML

<section id="smthn">
  <div class="container">
    <div class="nut">/*Lot of stuff inside*/</div>
    <div class="nut">/*Lot of stuff inside*/</div>
    <div class="nut">/*Lot of stuff inside*/</div>
  </div>
</section>

SCSS

#smthn{
 @include col(1);
 .container{
  @include center($grid-base-size);
   .nut{
    @include col(1/3, $cycle:3);
   }
  }
 }
}

Any ideas? Jeet is pretty new to me, so am I missing something here?

Keyboard support on mobile navigation

Sorry if this already came across your desk, i could have sworn I opened an issue here but I don't see it, perhaps it was an email. Or I'm losing my mind.

Anyways.

If you shrink your browser window to trigger the mobile navigation mode, and then start to tab through the document, the nav items in the mobile menu as in the tab order. If you open the mobile menu, and then close it, your tab context is still trapped in the mobile menu, so you can't navigate the rest of the document. I've tested this on a clean install with the latest commit.

I was able to fix this on my end with a few changes. The first being to reassign the event listeners on the menu from anonymous functions to declared functions, and then removing those event listeners on menu close. And second by changing the menu CSS to change the visibility to hidden and pointer events to none when closed.

It obviously changes the slide down behavior of the menu, but so far the solution on my end seems to be working fine. I'm happy to send a PR with my changes, but I thought I'd mention it first in case you had your own ideas on fixing it.

Bulma integration

Really enjoying Air - though i'm attempting to integrate the Bulma CSS Framework as i've become familiar with it with other projects, but i'm having trouble with the integration, any advice? (attempting via SASS so to be able to affect variables)

Warning: call_user_func_array() expects parameter 1 to be a valid callback

Hi guys,

I'm playing around with your theme (appreciate it) and here's the question:
whenever I try to add my own filters I get this error:

Warning: call_user_func_array() expects parameter 1 to be a valid callback

And I know that the filter is correct, because it is working with other themes. Here I'm trying to wrap post thumbnail in a <a> tag.

add_filter( 'post_thumbnail_html', 'wps_post_thumbnail', 10, 3 );
function wps_post_thumbnail( $html, $post_id, $post_image_id ) {
$html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a>'; return $html;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.