SkillAgentSearch skills...

SyliusTailwindTheme

A Tailwind CSS theme for Sylius

Install / Use

/learn @sbarbat/SyliusTailwindTheme
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<p align="center"> <img width="33.333%" src="https://sylius.com/wp-content/uploads/2018/07/logowhite.jpg" /> <img width="33.333%" src="https://i.imgur.com/EVV4jS8.png" /> <!-- <img width="33.333%" src="https://miro.medium.com/max/1032/1*OrjCKmou1jT4It5so5gvOA.jpeg" /> --> <h1 align="center">Sylius Tailwind Theme</h1> <p align="center">Sylius Tailwind theme with build process based on <a target="_blank" href="https://symfony.com/doc/current/frontend.html">Webpack Encore.</a></p> It allows to swap to Tailwind-based theme separately in each channel. </p>

This theme is under development, feel free to help building the tailwind views! 😁

Installation

  1. Copy files from repository to ./themes/TailwindTheme

  2. Install Encore

    composer require encore
    
  3. Install node dependencies

    yarn
    yarn add --dev @symfony/webpack-encore sass-loader node-sass tailwindcss autoprefixer postcss-loader webpack-notifier purgecss-webpack-plugin glob-all lodash path
    
  4. Create postcss config file

    # ./postcss.config.js
    module.exports = {
        plugins: [
            require('tailwindcss'),
            require('autoprefixer'),
        ]
    }
    
  5. Create Tailwind config file

    npx tailwind init
    
  6. Import tailwind-theme config in the main webpack file

    # ./webpack.config.js
    
    const Encore = require('@symfony/webpack-encore');
    const tailwindTheme = require('./themes/TailwindTheme/webpack.config');
    module.exports = [tailwindTheme];
    
  7. Edit project config files

    # ./config/packages/assets.yaml
    
    framework:
        assets:
            packages:
                bootstrapTheme:
                    json_manifest_path: '%kernel.project_dir%/public/tailwind-theme/manifest.json'  
    
    # ./config/packages/webpack_encore.yaml
    
    webpack_encore:
        output_path: '%kernel.project_dir%/public/tailwind-theme'
    
  8. To build the assets, run one of the following commands

    # compile assets once
    yarn encore dev      
    
    # recompile assets automatically when files change
    yarn encore dev --watch
    
    # recompile assets automatically with live reload
    yarn encore dev-server
    
    # create a production build
    yarn encore production
    
  9. Change theme in the admin panel by visiting the Edit Channel page

View on GitHub
GitHub Stars11
CategoryDevelopment
Updated1y ago
Forks1

Languages

HTML

Security Score

80/100

Audited on May 3, 2024

No findings