Sage-Tailwindcss Tailwind Templates

Sage Tailwindcss

A Starter Wordpress Theme build with Sage and Tailwindcss

Sage and Tailwind Wordpress Starter Theme

A WordPress starter theme with a modern development workflow, build with Sage and Tailwindcss

Features

  • Sass for stylesheets
  • Modern JavaScript
  • Webpack for compiling assets, optimizing images, and concatenating and minifying files
  • Browsersync for synchronized browser testing
  • Blade as a templating engine
  • Controller for passing data to Blade templates
  • Tailwind is a utility-first CSS framework for rapidly building custom user interfaces.

Requirements

Make sure all dependencies have been installed before moving on:

Theme installation

Clone this repositry (replace your-theme-name below with the name of your theme):

# @ wp-content/themes/
$ clone https://github.com/PILO7980/Sage-Tailwindcss.git your-theme-name

Install dependency:

# @ wp-content/themes/your-theme-name
$ yarn

Generates the tailwind.js config file in styles directory:

# @ wp-content/themes/your-theme-name
$ ./node_modules/.bin/tailwind init resources/assets/styles/tailwind.js

or if you have npx installed globally: (tip: you do have it if you are running npm 5.2.0+):

# @ wp-content/themes/your-theme-name
$ npx tailwind init resources/assets/styles/tailwind.js

Theme structure

themes/your-theme-name/   # → Root of your Sage based theme
├── app/                  # → Theme PHP
│   ├── controllers/      # → Controller files
│   ├── admin.php         # → Theme customizer setup
│   ├── filters.php       # → Theme filters
│   ├── helpers.php       # → Helper functions
│   └── setup.php         # → Theme setup
├── composer.json         # → Autoloading for `app/` files
├── composer.lock         # → Composer lock file (never edit)
├── dist/                 # → Built theme assets (never edit)
├── node_modules/         # → Node.js packages (never edit)
├── package.json          # → Node.js dependencies and scripts
├── resources/            # → Theme assets and templates
│   ├── assets/           # → Front-end assets
│   │   ├── config.json   # → Settings for compiled assets
│   │   ├── build/        # → Webpack and ESLint config
│   │   ├── fonts/        # → Theme fonts
│   │   ├── images/       # → Theme images
│   │   ├── scripts/      # → Theme JS
│   │   └── styles/       # → Theme stylesheets
│   ├── functions.php     # → Composer autoloader, theme includes
│   ├── index.php         # → Never manually edit
│   ├── screenshot.png    # → Theme screenshot for WP admin
│   ├── style.css         # → Theme meta information
│   └── views/            # → Theme templates
│       ├── layouts/      # → Base templates
│       └── partials/     # → Partial templates
└── vendor/               # → Composer packages (never edit)

Theme setup

Edit app/setup.php to enable or disable theme features, setup navigation menus, post thumbnail sizes, and sidebars.

Theme development

  • Update resources/assets/config.json settings:
    • devUrl should reflect your local development hostname
    • publicPath should reflect your WordPress folder structure (/wp-content/themes/your-theme-name for standards Worpress installs)

Build commands

  • yarn start — Compile assets when file changes are made, start Browsersync session
  • yarn build — Compile and optimize the files in your assets directory
  • yarn build:production — Compile assets for production

Documentation

Top categories

Loading Svelte Themes