Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to integrate with Tailwind? #2

Closed
mamcx opened this issue Apr 24, 2020 · 2 comments
Closed

How to integrate with Tailwind? #2

mamcx opened this issue Apr 24, 2020 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@mamcx
Copy link

mamcx commented Apr 24, 2020

I have tried to setup this with tailwind but is not clear for me how exactly. I try importing as tailwind plugin:

module.exports = {
  	theme: {
    	extend: {},
  	},
  	variants: {},
	plugins: [
    	require('@a17t'),
  	]
}

How a postcss:

module.exports = {
  plugins: [
  	require('a17t'),
    require('tailwindcss'),
    require('autoprefixer'),
  ]
}

Or with a direct import on my main css

@import "a17t";
@import "tailwindcss/base";
@import "tailwindcss/components";

None work for me. (ps: I'm not very fluent in the JS ecosystem so if this is something obvious is not for me)

@ortuagustin
Copy link

ortuagustin commented Apr 28, 2020

You should import a17t in a .js file, ie

src/main.js

import 'a17t'
import './assets/app.css'

assets/app.css

@tailwind base;
@tailwind components;
@tailwind utilities;

postcss.config.js

module.exports = {
  plugins: [
    require('tailwindcss'),
    require('autoprefixer'),
  ]
}

Then, PostCSS will process the tailwind directives; a17t is already processed. You can check the package.json file in this repo that the main file that gets imported is the css

{
  "name": "a17t",
  "version": "0.1.4",
  "description": "Atomic design toolkit for beautiful, maintainable, and custom interfaces",
  "main": "dist/a17t.css",
...
}

PS: I've tested this with an empty Vue app

@milesmcc
Copy link
Owner

Thanks for explaining, @ortuagustin. I’ll expand the documentation to better explain how to integrate a17t.

@milesmcc milesmcc changed the title How exactly integrate with tailwind? How to integrate with Tailwind? Apr 28, 2020
@milesmcc milesmcc added the documentation Improvements or additions to documentation label Apr 28, 2020
@mamcx mamcx closed this as completed Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants