diff --git a/src/Init/tailwind/theme/index.php b/src/Init/tailwind/theme/index.php new file mode 100644 index 000000000..afa6ae3d7 --- /dev/null +++ b/src/Init/tailwind/theme/index.php @@ -0,0 +1,19 @@ + + + Ruleset for the Eightshift Boilerplate. + + + + */tests/* + */vendor/* + */vendor-prefixed/* + */public/* + */node_modules/* + + + + + + + + . + + + + + + + + + /src/CompiledContainer\.php + + + + + + + + + diff --git a/src/Init/tailwind/theme/phpstan.neon.dist b/src/Init/tailwind/theme/phpstan.neon.dist new file mode 100644 index 000000000..1a7ad2080 --- /dev/null +++ b/src/Init/tailwind/theme/phpstan.neon.dist @@ -0,0 +1,17 @@ +includes: + - vendor/szepeviktor/phpstan-wordpress/extension.neon +parameters: + level: 6 + inferPrivatePropertyTypeFromConstructor: true + treatPhpDocTypesAsCertain: false + bootstrapFiles: + - vendor-prefixed/autoload.php + paths: + - src/ + ignoreErrors: + # Block templates + - '#^Variable \$attributes might not be defined\.#' + - '#^Variable \$renderContent might not be defined\.#' + - '#^Variable \$this might not be defined\.#' + - '#^Variable \$templatePath might not be defined\.#' + - identifier: missingType.generics diff --git a/src/Init/tailwind/theme/postcss.config.js b/src/Init/tailwind/theme/postcss.config.js new file mode 100644 index 000000000..943e6fcd1 --- /dev/null +++ b/src/Init/tailwind/theme/postcss.config.js @@ -0,0 +1,7 @@ +const autoprefixer = require('autoprefixer'); + +module.exports = { + plugins: [ + autoprefixer, + ], +}; diff --git a/src/Init/tailwind/theme/screenshot.png b/src/Init/tailwind/theme/screenshot.png new file mode 100644 index 000000000..0938147b4 Binary files /dev/null and b/src/Init/tailwind/theme/screenshot.png differ diff --git a/src/Init/tailwind/theme/single.php b/src/Init/tailwind/theme/single.php new file mode 100644 index 000000000..82018a316 --- /dev/null +++ b/src/Init/tailwind/theme/single.php @@ -0,0 +1,19 @@ + { + addComponents({ + '.font-synthesis-none': { + 'font-synthesis': 'none', + }, + '.font-synthesis': { + 'font-synthesis': 'auto', + }, + }); + addVariant('open', '&.is-open'); + addVariant('wp-logged-in', 'body.logged-in &'); + addVariant('wp-logged-in-mobile', '@media (max-width: 782px) { body.logged-in & }'); + }), + ], +}; diff --git a/src/Init/tailwind/theme/webpack.config.js b/src/Init/tailwind/theme/webpack.config.js new file mode 100644 index 000000000..e7ec717a4 --- /dev/null +++ b/src/Init/tailwind/theme/webpack.config.js @@ -0,0 +1,19 @@ +/** + * This is a main entrypoint for Webpack config. + * All the settings are pulled from node_modules/@eightshift/frontend-libs/webpack. + * We are loading mostly used configuration but you can always override or turn off the default setup and provide your own. + * Please referer to Eightshift-libs wiki for details. + */ +module.exports = (env, argv) => { + + const projectConfig = { + config: { + projectDir: __dirname, // Current project directory absolute path. + projectUrl: '%g_site_url%', // Used for providing browsersync functionality. + projectPath: 'wp-content/themes/%g_textdomain%', // Project path relative to project root. + }, + }; + + // Generate webpack config for this project using options object. + return require('@eightshift/frontend-libs-tailwind/webpack')(argv.mode, projectConfig); +}; diff --git a/src/Init/theme/babel.config.js b/src/Init/theme/babel.config.js deleted file mode 100644 index 032bab832..000000000 --- a/src/Init/theme/babel.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - extends: './node_modules/@eightshift/frontend-libs/babel/babel.config.js', -};