Initial commit

This commit is contained in:
Gilles Van Assche 2024-11-12 12:05:01 +01:00
commit de134050aa
30 changed files with 20699 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/node_modules
/.idea
/.vscode

24
404.php Normal file
View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<link rel="profile" href="http://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>
<body class="antialiased">
<div class="md:flex min-h-screen">
<div class="w-full md:w-1/2 flex items-center justify-center">
<div class="max-w-sm m-8">
<div class="text-5xl md:text-15xl text-gray-800 border-primary border-b">404</div>
<div class="w-16 h-1 bg-purple-light my-3 md:my-6"></div>
<p class="text-gray-800 text-2xl md:text-3xl font-light mb-8"><?php _e( 'Sorry, the page you are looking for could not be found.', 'tailpress' ); ?></p>
<a href="<?php echo get_bloginfo( 'url' ); ?>" class="bg-primary px-4 py-2 rounded text-white">
<?php _e( 'Go Home', 'tailpress' ); ?>
</a>
</div>
</div>
</div>
</body>
</html>

114
CHANGELOG.md Normal file
View File

@ -0,0 +1,114 @@
# Changelog
All notable changes to TailPress will be documented in this file.
## Unreleased
- Use `mix.options({ manifest: false })` instead of deprecated `Mix.manifest.refresh = _ => void 0`
## 3.3.0
- Update to Tailwind 3.3.0
- Laravel Mix is now the default compiler (with the TailPress installer (^v2.0.0), use `compiler="esbuild"` if you want to keep using esbuild)
## 3.2.0
- Update to Tailwind 3.2.0
## 3.1.0
- Tailwind font sizes are now set as defined in `theme.json`.
- Breakpoints now based on WordPress defaults (https://developer.wordpress.org/block-editor/reference-guides/packages/packages-viewport/#usage).
- Providing `w-content`, `max-w-content`, `w-wide` and `max-w-wide` utility classes.
- Content width is now actually the width as defined in `theme.json`.
- Fixing align wide, width as defined in `theme.json`.
- Updating Tailwind CSS to version 3.1.0.
- Fix issues package.json scripts on Windows.
## 3.0.0 - 2021-12-14
- Updating Tailwind to 3.0.0.
### TailPress installer
- The TailPress installer (^0.2.0) now allows you to use Laravel Mix instead of esbuild by setting --compiler=mix.
- You may now also set dbname, dbuser, dbpass and dbhost.
## 2.0.0 - 2021-09-03
- Switching to Tailwind CLI and esbuild instead of LaraveL Mix.
- Removing `theme` subdirectory setup as it is no longer needed with the new build setup.
- Removing `TailPress` class and it's functions (`tailpress()->get_header()` etc.) throughout the theme.
- New `tailpress_asset` function to get the URL of an asset (previously `tailpress_mix`).
- `tailpress_asset` function thaty appends a `time` parameter if [wp_get_environment_type()](https://developer.wordpress.org/reference/functions/wp_get_environment_type/) does not return `production` for cache busting (instead of the previously used versioned assets through `mix-manifest.json`).
- Update screenshot.png.
- Remove `block-editor.css`, only use `editor-style.css`.
- Moving `editor-style.css` from root to `css` directory.
- Update readme.
## 1.0.0 - 2021-08-25
- Replace `tailpress.json` with `theme.json` as used by WordPress core.
- Move template files into `theme` subdirectory.
- Move tailwind plugin to a [separate repository](https://github.com/jeffreyvr/tailwindcss-tailpress).
- Update readme and adding section on using installer.
## 0.1.0 - 2021-06-17
- No longer depending on jQuery.
- Fixes text color classes for the Block Editor.
- Use safelist.txt to prevent WP classes from being purged.
- Readme changes.
- MIT License.
## 0.0.9 - 2021-04-05
- Updating to Tailwind CSS v2.1 which includes the JIT engine in core among other things.
## 0.0.8 - 2021-03-23
- Using TailwindCSS JIT for way faster compiling.
- Updated readme.
- Fix loading styling in block editor.
- Check if mix-manifest.json file exists to prevent warning message.
## 0.0.7 - 2021-02-15
- Adding the option to apply submenu_class to the wp_nav_menu args.
- Adding the option to apply classes on li_class and submenu_class on specific depths, like: li_class_0.
### 0.0.6 - 2021-02-08
- Fixes issue on Windows.
## 0.0.5 - 2020-12-24
- Set selectors on single line since this seems to cause issues (nested CSS) with production build (#241a612).
## 0.0.4 - 2020-12-23
- Add nested CSS support for PostCSS.
- Minor readme changes.
## 0.0.3 - 2020-12-22
- Update Laravel Mix from version 5^ to 6^.
- Removing Laravel Mix Tailwind, defining plugins within webpack.mix.js instead.
- Switching from Sass to PostCSS for faster compiling.
- Moved TailPress colors and font size settings to tailpress.json file.
- Use tailpress.json to populate editor-color-palette and editor-font-sizes theme support automatically.
- New screenshot.
- Update readme.
- Other minor fixes and improvements.
## 0.0.2 - 2020-11-24
- Adding basic support for the block editor Gutenberg by generating alignment, font size and color classes.
Contains four theme colors out of the box, being primary, secondary, dark and light. This is adjustable of course.
- Loading a editor-style.css.
- Removing double slashes on resulting manifest asset URLs.
- Modified template files to have a better starting point (including horizontal main navigation, footer always at the bottom for short pages).
- Added a basic 404 page template.
## 0.0.1 - 2020-11-19
- Init release.

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) Jeffrey van Rossum <jeffrey@vanrossum.dev>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

99
README.MD Normal file
View File

@ -0,0 +1,99 @@
<p><img src="http://tailpress.io/images/tailpress100.svg" width="260" alt="TailPress"></p>
[![GitHub release](https://img.shields.io/github/release/jeffreyvr/tailpress?include_prereleases=&sort=semver)](https://github.com/jeffreyvr/tailpress/releases/)
[![License](https://img.shields.io/badge/License-MIT-blue)](#license)
# Introduction
TailPress is a minimal boilerplate theme for WordPress using [Tailwind CSS](https://tailwindcss.com/).
## Getting started
### Using the installer
You can get started using the installer (using composer):
```bash
composer global require jeffreyvanrossum/tailpress-installer
tailpress new example-theme
```
*If the tailpress command is not found, make sure to place Composer's global vendor bin in your `$PATH` ([see](#command-tailpress-not-found)).*
Flags you can pass when using the installer:
- Set a theme name `--name="Example Theme"`
- Choose your compiler, mix or esbuild: `--compiler="esbuild"`
- Initialize a git repository `--git`
- Set the git branch name `--branch="main"`
If you choose to install WordPress through the installer, these flags might be of interest as well:
`--dbname`, `--dbuser`, `--dbpass` and `--dbhost`.
Once your theme is ready, don't forget to cd into the directory.
You will be asked if you would like to have WordPress installed as well. Keep in mind that you still need a local development environment for PHP and MySQL.
### Regular method
* Clone repo `git clone https://github.com/jeffreyvr/tailpress.git && cd tailpress`
* Run `rm -rf .git` to remove git (or `rmdir .git` for Windows)
* Run `npm install`
* Run `npm run watch` to start developing
### General
You will find the editable CSS and Javascript files within the `/resources` folder.
Before you use your theme in production, make sure you run `npm run production`.
## NPM Scripts
There are several NPM scripts available. You'll find the full list in the `package.json` file under "scripts". A script is executed through the terminal by running `npm run script-name`.
| Script | Description |
|------------|--------------------------------------------------------------------------------|
| production | Creates a production (minified) build of app.js, app.css and editor-style.css. |
| dev | Creates a development build of app.js, app.css and editor-style.css. |
| watch | Runs several watch scripts concurrently. |
## Tips
### Styling within the block editor
To make the editing experience within the block editor more in line with the front end styling, a `editor-style.css` is generated.
### CSS classes generated by TailPress
CSS classes for alignment (full, wide etc.) are generated automatically. You can opt-out on this by removing the plugin from the `tailwind.config.js` file.
### Customize colors
Several colors and font sizes are defined from the beginning. You can modify them in `theme.json`.
### Command `tailpress` not found
Make sure to place Composer's global vendor bin directory in your `$PATH` so the `tailpress` executable can be found by your system. This directory exists in different locations based on your operating system; however, some common locations include:
- macOS: `$HOME/.composer/vendor/bin`
- Windows: `%USERPROFILE%\AppData\Roaming\Composer\vendor\bin`
- GNU / Linux Distributions: `$HOME/.config/composer/vendor/bin or $HOME/.composer/vendor/bin`
You could also find the composer's global installation path by running `composer global about` and looking up from the first line.
## Links
* [TailPress website](https://tailpress.io)
* [Screencasts](https://www.youtube.com/playlist?list=PL6GBdOp044SHIOSCZejodwr1HcYsC43wG)
* [Tailwind CSS Documentation](https://tailwindcss.com/docs)
* [Laravel Mix Documentation](https://laravel-mix.com)
* [Esbuild Documentation](https://esbuild.github.io)
## Contributors
* [Jeffrey van Rossum](https://github.com/jeffreyvr)
* [All contributors](https://github.com/jeffreyvr/tailpress/graphs/contributors)
## License
MIT. Please see the [License File](/LICENSE) for more information.

74
comments.php Normal file
View File

@ -0,0 +1,74 @@
<?php
/**
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() ) {
return;
}
?>
<div id="comments" class="comments-area my-8">
<?php if ( have_comments() ) : ?>
<h2 class="comments-title">
<?php
printf(
_nx( 'One comment', '%1$s comments', get_comments_number(), 'comments title', 'tailpress' ),
number_format_i18n( get_comments_number() ),
get_the_title()
);
?>
</h2>
<ol class="comment-list">
<?php
wp_list_comments(
array(
'style' => 'ol',
'short_ping' => true,
'avatar_size' => 56,
)
);
?>
</ol>
<?php endif; ?>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
<nav class="comment-navigation" id="comment-nav-above">
<h1 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'tailpress' ); ?></h1>
<?php if ( get_previous_comments_link() ) { ?>
<div class="nav-previous">
<?php previous_comments_link( __( '&larr; Older Comments', 'tailpress' ) ); ?>
</div>
<?php } ?>
<?php if ( get_next_comments_link() ) { ?>
<div class="nav-next">
<?php next_comments_link( __( 'Newer Comments &rarr;', 'tailpress' ) ); ?>
</div>
<?php } ?>
</nav><!-- #comment-nav-above -->
<?php endif; ?>
<?php if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'tailpress' ); ?></p>
<?php endif; ?>
<?php
comment_form(
array(
'class_submit' => 'bg-primary text-white cursor-pointer rounded font-bold py-2 px-4',
'comment_field' => '<textarea id="comment" name="comment" class="bg-gray-200 w-full py-2 px-3" aria-required="true"></textarea>',
)
);
?>
</div>

1
css/app.css Normal file

File diff suppressed because one or more lines are too long

1
css/editor-style.css Normal file

File diff suppressed because one or more lines are too long

23
footer.php Normal file
View File

@ -0,0 +1,23 @@
</main>
<?php do_action( 'tailpress_content_end' ); ?>
</div>
<?php do_action( 'tailpress_content_after' ); ?>
<footer id="colophon" class="site-footer bg-gray-50 py-12" role="contentinfo">
<?php do_action( 'tailpress_footer' ); ?>
<div class="container mx-auto text-center text-gray-500">
&copy; <?php echo date_i18n( 'Y' );?> - <?php echo get_bloginfo( 'name' );?>
</div>
</footer>
</div>
<?php wp_footer(); ?>
</body>
</html>

111
functions.php Normal file
View File

@ -0,0 +1,111 @@
<?php
/**
* Theme setup.
*/
function tailpress_setup() {
add_theme_support( 'title-tag' );
register_nav_menus(
array(
'primary' => __( 'Primary Menu', 'tailpress' ),
)
);
add_theme_support(
'html5',
array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
)
);
add_theme_support( 'custom-logo' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'align-wide' );
add_theme_support( 'wp-block-styles' );
add_theme_support( 'responsive-embeds' );
add_theme_support( 'editor-styles' );
add_editor_style( 'css/editor-style.css' );
}
add_action( 'after_setup_theme', 'tailpress_setup' );
/**
* Enqueue theme assets.
*/
function tailpress_enqueue_scripts() {
$theme = wp_get_theme();
wp_enqueue_style( 'tailpress', tailpress_asset( 'css/app.css' ), array(), $theme->get( 'Version' ) );
wp_enqueue_script( 'tailpress', tailpress_asset( 'js/app.js' ), array(), $theme->get( 'Version' ) );
}
add_action( 'wp_enqueue_scripts', 'tailpress_enqueue_scripts' );
/**
* Get asset path.
*
* @param string $path Path to asset.
*
* @return string
*/
function tailpress_asset( $path ) {
if ( wp_get_environment_type() === 'production' ) {
return get_stylesheet_directory_uri() . '/' . $path;
}
return add_query_arg( 'time', time(), get_stylesheet_directory_uri() . '/' . $path );
}
/**
* Adds option 'li_class' to 'wp_nav_menu'.
*
* @param string $classes String of classes.
* @param mixed $item The current item.
* @param WP_Term $args Holds the nav menu arguments.
*
* @return array
*/
function tailpress_nav_menu_add_li_class( $classes, $item, $args, $depth ) {
if ( isset( $args->li_class ) ) {
$classes[] = $args->li_class;
}
if ( isset( $args->{"li_class_$depth"} ) ) {
$classes[] = $args->{"li_class_$depth"};
}
return $classes;
}
add_filter( 'nav_menu_css_class', 'tailpress_nav_menu_add_li_class', 10, 4 );
/**
* Adds option 'submenu_class' to 'wp_nav_menu'.
*
* @param string $classes String of classes.
* @param mixed $item The current item.
* @param WP_Term $args Holds the nav menu arguments.
*
* @return array
*/
function tailpress_nav_menu_add_submenu_class( $classes, $args, $depth ) {
if ( isset( $args->submenu_class ) ) {
$classes[] = $args->submenu_class;
}
if ( isset( $args->{"submenu_class_$depth"} ) ) {
$classes[] = $args->{"submenu_class_$depth"};
}
return $classes;
}
add_filter( 'nav_menu_submenu_css_class', 'tailpress_nav_menu_add_submenu_class', 10, 3 );

94
header.php Normal file
View File

@ -0,0 +1,94 @@
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
</head>
<body <?php body_class( 'bg-white text-gray-900 antialiased' ); ?>>
<?php do_action( 'tailpress_site_before' ); ?>
<div id="page" class="min-h-screen flex flex-col">
<?php do_action( 'tailpress_header' ); ?>
<header>
<div class="mx-auto container">
<div class="lg:flex lg:justify-between lg:items-center border-b py-6">
<div class="flex justify-between items-center">
<div>
<?php if ( has_custom_logo() ) { ?>
<?php the_custom_logo(); ?>
<?php } else { ?>
<a href="<?php echo get_bloginfo( 'url' ); ?>" class="font-extrabold text-lg uppercase">
<?php echo get_bloginfo( 'name' ); ?>
</a>
<p class="text-sm font-light text-gray-600">
<?php echo get_bloginfo( 'description' ); ?>
</p>
<?php } ?>
</div>
<div class="lg:hidden">
<a href="#" aria-label="Toggle navigation" id="primary-menu-toggle">
<svg viewBox="0 0 20 20" class="inline-block w-6 h-6" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g stroke="none" stroke-width="1" fill="currentColor" fill-rule="evenodd">
<g id="icon-shape">
<path d="M0,3 L20,3 L20,5 L0,5 L0,3 Z M0,9 L20,9 L20,11 L0,11 L0,9 Z M0,15 L20,15 L20,17 L0,17 L0,15 Z"
id="Combined-Shape"></path>
</g>
</g>
</svg>
</a>
</div>
</div>
<?php
wp_nav_menu(
array(
'container_id' => 'primary-menu',
'container_class' => 'hidden bg-gray-100 mt-4 p-4 lg:mt-0 lg:p-0 lg:bg-transparent lg:block',
'menu_class' => 'lg:flex lg:-mx-4',
'theme_location' => 'primary',
'li_class' => 'lg:mx-4',
'fallback_cb' => false,
)
);
?>
</div>
</div>
</header>
<div id="content" class="site-content flex-grow">
<?php if ( is_front_page() ) { ?>
<!-- Start introduction -->
<div class="container mx-auto">
<div class="px-12 py-16 my-12 rounded-xl bg-gradient-to-r from-blue-50 from-10% via-sky-100 via-30% to-blue-200 to-90%">
<div class="mx-auto max-w-screen-md">
<h1 class="text-3xl lg:text-6xl tracking-tight font-extrabold text-gray-800 mb-6">Start building your next <a href="https://tailwindcss.com" class="text-secondary">Tailwind CSS</a> flavoured WordPress theme
with <a href="https://tailpress.io" class="text-primary">TailPress</a>.</h1>
<p class="text-gray-600 text-xl font-medium mb-10">TailPress is your go-to starting
point for developing WordPress themes with Tailwind CSS and comes with basic block-editor support out
of the box.</p>
<a href="https://github.com/jeffreyvr/tailpress"
class="w-full sm:w-auto flex-none bg-gray-900 text-white text-lg leading-6 font-semibold py-3 px-6 border border-transparent rounded-xl focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-gray-900 focus:outline-none transition-colors duration-200">View
on GitHub</a>
</div>
</div>
</div>
<!-- End introduction -->
<?php } ?>
<?php do_action( 'tailpress_content_start' ); ?>
<main>

20
index.php Normal file
View File

@ -0,0 +1,20 @@
<?php get_header(); ?>
<div class="container mx-auto my-8">
<?php if ( have_posts() ) : ?>
<?php
while ( have_posts() ) :
the_post();
?>
<?php get_template_part( 'template-parts/content', get_post_format() ); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php
get_footer();

1
js/app.js Normal file
View File

@ -0,0 +1 @@
(()=>{var e,r={80:()=>{window.addEventListener("load",(function(){var e=document.querySelector("#primary-menu");document.querySelector("#primary-menu-toggle").addEventListener("click",(function(r){r.preventDefault(),e.classList.toggle("hidden")}))}))},662:()=>{},797:()=>{}},t={};function n(e){var o=t[e];if(void 0!==o)return o.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,n),i.exports}n.m=r,e=[],n.O=(r,t,o,i)=>{if(!t){var a=1/0;for(u=0;u<e.length;u++){for(var[t,o,i]=e[u],l=!0,s=0;s<t.length;s++)(!1&i||a>=i)&&Object.keys(n.O).every((e=>n.O[e](t[s])))?t.splice(s--,1):(l=!1,i<a&&(a=i));if(l){e.splice(u--,1);var v=o();void 0!==v&&(r=v)}}return r}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[t,o,i]},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={773:0,842:0,170:0};n.O.j=r=>0===e[r];var r=(r,t)=>{var o,i,[a,l,s]=t,v=0;if(a.some((r=>0!==e[r]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(s)var u=s(n)}for(r&&r(t);v<a.length;v++)i=a[v],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return n.O(u)},t=self.webpackChunktailpress=self.webpackChunktailpress||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),n.O(void 0,[842,170],(()=>n(80))),n.O(void 0,[842,170],(()=>n(662)));var o=n.O(void 0,[842,170],(()=>n(797)));o=n.O(o)})();

5
mix-manifest.json Normal file
View File

@ -0,0 +1,5 @@
{
"/js/app.js": "/js/app.js?id=435e606374bb44ea06de4ae5b0e31f61",
"/css/editor-style.css": "/css/editor-style.css?id=03a0a90cc989a9d4c480a752574b37c3",
"/css/app.css": "/css/app.css?id=1574f199e487c866afb056200ee1e6ce"
}

19746
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

34
package.json Normal file
View File

@ -0,0 +1,34 @@
{
"name": "tailpress",
"version": "3.4.0",
"description": "Boilerplate WordPress theme with Tailwind CSS.",
"author": "Jeffrey van Rossum",
"repository": {
"type": "git",
"url": "https://github.com/jeffreyvr/tailpress"
},
"theme_uri": "https://github.com/jeffreyvr/tailpress",
"author_uri": "https://vanrossum.dev",
"text_domain": "tailpress",
"license": "MIT",
"scripts": {
"dev": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"production": "mix --production"
},
"devDependencies": {
"@jeffreyvr/tailwindcss-tailpress": "^2.0.0",
"autoprefixer": "^10.4.0",
"browser-sync": "^2.26.14",
"cross-env": "^6.0.3",
"laravel-mix": "^6.0.29",
"postcss": "^8.2.10",
"postcss-import": "^14.0.0",
"postcss-nested": "^5.0.3",
"postcss-nested-ancestors": "^2.0.0",
"resolve-url-loader": "^3.1.2",
"tailwindcss": "^3.4.0"
}
}

8
postcss.config.js Normal file
View File

@ -0,0 +1,8 @@
module.exports = {
plugins: [
require('postcss-import'),
require('tailwindcss/nesting'),
require('tailwindcss'),
require('autoprefixer')
]
}

5
resources/css/app.css Normal file
View File

@ -0,0 +1,5 @@
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
@import "custom.css";

42
resources/css/custom.css Normal file
View File

@ -0,0 +1,42 @@
article > *:not(.entry-content),
.entry-content > * {
@apply mx-auto max-w-content;
}
.entry-content, .block-editor-block-list__layout {
h1 {
@apply text-2xl;
}
h2 {
@apply text-xl;
}
h3 {
@apply text-lg;
}
p, ul, ol {
a {
@apply text-blue-500 underline;
&:hover {
@apply no-underline;
}
}
@apply mb-8;
}
ul:not(.block-editor-block-variation-picker__variations) {
li {
@apply list-disc list-inside;
}
}
ol {
li {
@apply list-decimal list-inside;
}
}
}

View File

@ -0,0 +1,18 @@
@import "tailwindcss/components";
@import "tailwindcss/utilities";
body {
@apply font-sans;
}
.wp-block{
@apply max-w-screen-xl;
}
.wp-block[data-align=wide] {
@apply max-w-screen-xl;
}
.wp-block[data-align=full] {
@apply max-w-full;
}

8
resources/js/app.js Normal file
View File

@ -0,0 +1,8 @@
// Navigation toggle
window.addEventListener('load', function () {
let main_navigation = document.querySelector('#primary-menu');
document.querySelector('#primary-menu-toggle').addEventListener('click', function (e) {
e.preventDefault();
main_navigation.classList.toggle('hidden');
});
});

8
safelist.txt Normal file
View File

@ -0,0 +1,8 @@
alignfull
alignwide
alignnone
aligncenter
alignright
wp-block-button
wp-caption
wp-caption-text

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

28
single.php Normal file
View File

@ -0,0 +1,28 @@
<?php get_header(); ?>
<div class="container my-8 mx-auto">
<?php if ( have_posts() ) : ?>
<?php
while ( have_posts() ) :
the_post();
?>
<?php get_template_part( 'template-parts/content', 'single' ); ?>
<?php
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php
get_footer();

8
style.css Normal file
View File

@ -0,0 +1,8 @@
/*
Theme Name: Deligraph - Ceinture culturelle
Author: Deligraph Team
Author URI: https://deligraph.com
Description: Theme wordpress pour la ceinture culturelle
Version: 0.0.1
Text Domain: deligraph
*/

37
tailwind.config.js Normal file
View File

@ -0,0 +1,37 @@
const theme = require('./theme.json');
const tailpress = require("@jeffreyvr/tailwindcss-tailpress");
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./*.php',
'./**/*.php',
'./resources/css/*.css',
'./resources/js/*.js',
'./safelist.txt'
],
theme: {
container: {
padding: {
DEFAULT: '1rem',
sm: '2rem',
lg: '0rem'
},
},
extend: {
colors: tailpress.colorMapper(tailpress.theme('settings.color.palette', theme)),
fontSize: tailpress.fontSizeMapper(tailpress.theme('settings.typography.fontSizes', theme))
},
screens: {
'xs': '480px',
'sm': '600px',
'md': '782px',
'lg': tailpress.theme('settings.layout.contentSize', theme),
'xl': tailpress.theme('settings.layout.wideSize', theme),
'2xl': '1440px'
}
},
plugins: [
tailpress.tailwind
]
};

View File

@ -0,0 +1,25 @@
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header mb-4">
<?php the_title( sprintf( '<h1 class="entry-title text-2xl lg:text-5xl font-extrabold leading-tight mb-1"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?>
<time datetime="<?php echo get_the_date( 'c' ); ?>" itemprop="datePublished" class="text-sm text-gray-700"><?php echo get_the_date(); ?></time>
</header>
<div class="entry-content">
<?php the_content(); ?>
<?php
wp_link_pages(
array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'tailpress' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'tailpress' ) . ' </span>%',
'separator' => '<span class="screen-reader-text">, </span>',
)
);
?>
</div>
</article>

View File

@ -0,0 +1,41 @@
<article id="post-<?php the_ID(); ?>" <?php post_class( 'mb-12' ); ?>>
<header class="entry-header mb-4">
<?php the_title( sprintf( '<h2 class="entry-title text-2xl md:text-3xl font-extrabold leading-tight mb-1"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
<time datetime="<?php echo get_the_date( 'c' ); ?>" itemprop="datePublished" class="text-sm text-gray-700"><?php echo get_the_date(); ?></time>
</header>
<?php if ( is_search() || is_archive() ) : ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div>
<?php else : ?>
<div class="entry-content">
<?php
/* translators: %s: Name of current post */
the_content(
sprintf(
__( 'Continue reading %s', 'tailpress' ),
the_title( '<span class="screen-reader-text">"', '"</span>', false )
)
);
wp_link_pages(
array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'tailpress' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'tailpress' ) . ' </span>%',
'separator' => '<span class="screen-reader-text">, </span>',
)
);
?>
</div>
<?php endif; ?>
</article>

67
theme.json Normal file
View File

@ -0,0 +1,67 @@
{
"version": 1,
"settings": {
"layout": {
"contentSize": "960px",
"wideSize": "1280px"
},
"color": {
"palette": [
{
"name": "Primary",
"slug": "primary",
"color": "#0EA5E9"
},
{
"name": "Secondary",
"slug": "secondary",
"color": "#14B8A6"
},
{
"name": "Dark",
"slug": "dark",
"color": "#1F2937"
},
{
"name": "Light",
"slug": "light",
"color": "#F9FAFB"
}
]
},
"typography": {
"fontSizes": [
{
"name": "Small",
"slug": "small",
"size": "0.875rem"
},
{
"slug": "regular",
"name": "Regular",
"size": "1.5rem"
},
{
"slug": "large",
"name": "Large",
"size": "1.125rem"
},
{
"slug": "xl",
"name": "XL",
"size": "1.25rem"
},
{
"slug": "xxl",
"name": "2XL",
"size": "1.5rem"
},
{
"slug": "xxxl",
"name": "3XL",
"size": "1.875rem"
}
]
}
}
}

33
webpack.mix.js Normal file
View File

@ -0,0 +1,33 @@
let mix = require('laravel-mix');
let path = require('path');
mix.setResourceRoot('../');
mix.setPublicPath(path.resolve('./'));
mix.webpackConfig({
watchOptions: { ignored: [
path.posix.resolve(__dirname, './node_modules'),
path.posix.resolve(__dirname, './css'),
path.posix.resolve(__dirname, './js')
] }
});
mix.js('resources/js/app.js', 'js');
mix.postCss("resources/css/app.css", "css");
mix.postCss("resources/css/editor-style.css", "css");
// mix.browserSync({
// proxy: 'http://tailpress.test',
// host: 'tailpress.test',
// open: 'external',
// port: 8000
// injectChanges: true
// });
if (mix.inProduction()) {
mix.version();
} else {
mix.options({ manifest: false });
}