Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AungHtetPaing__'s avatar

Tailwind typography not working

Hi i'm working on laracasts "rebuild github" series. In episode 4, i'm facing a problem with tailwind typography.

I installed tailwind typography, add the plugin to tailwind.config.js and use "prose" class in the index.html .

Here is what i did

tailwind.config.js

module.exports = {
  purge: [],
  darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [
    require('@tailwindcss/typography'),
  ],
}

index.html

<article class="px-5 mt-4 prose">
                            <h1>heading</h1>
                            <p>paragraph</p>
                            ```
                                code
                            ```
                        </article>

Do i need to use vue and import the readme.md file as andre did in the series?

0 likes
12 replies
AungHtetPaing__'s avatar

Tailwind typography work with cdn

<!-- From UNPKG -->
<link
  rel="stylesheet"
  href="https://unpkg.com/@tailwindcss/[email protected]/dist/typography.min.css"
/>

Installation from npm doesn't work. I installed tailwind as postcss plugin. Does anyone know correct installation of tailwind and tailwind plugin?

pazitron's avatar

Did you install the package via npm - npm install @tailwindcss/typography ? after that and requiring the package in your tainiwnd config runnpm run dev to rebuild the front end assets.

1 like
AungHtetPaing__'s avatar

Yes i install with

npm install @tailwindcss/typography

In my package.json there is no dev script. I made it with

npm init -y

So how can i rebuild the front end assets?

pazitron's avatar

in your terminal, in the project folder run npm run watch or npm run dev

1 like
AungHtetPaing__'s avatar

@pazitron No they don't work. In my package.json there is no script. So if i run

npm run watch or npm run dev

it show "npm ERR! missing script: dev"

pazitron's avatar

all I can think of is you're running your npm commands from the wrong directory. What is in your package.json?

1 like
AungHtetPaing__'s avatar

NO wrong directory. In laravel, vue and tailwind, there is npm script. So i can run npm run dev or npm run watch.

But now i don't have laravel, i just use html and tailwind that all. There is no dev script. Anyway thank for your reply.

pazitron's avatar

oh... I did not realise it's not a laravel app. Have a look at the tailwind docs https://tailwindcss.com/docs/installation#using-tailwind-cli looks like you need to re-run the compilation of your public css file after you made changes to the tailwind.config.

Depending on the setup, it should be npx tailwindcss -o tailwind.css which basically takes the config file and generates a main.css file in the public directory.

You might need to specify the location to the config and the output of the main.css file:

npx tailwindcss -i ./src/tailwind.css -o ./dist/tailwind.css

1 like
AungHtetPaing__'s avatar

No it doesn't work. I already tried that command. I installed tailwind and build it with that command.

So tailwind is working. But tailwind typography plugin doesn't work. I also installed postcss-cli and compiled again.

Same result no working. It is strange. I think I should use laravel, vue as andre did in that serie.

jasonlamv-t's avatar
Level 1

@AungHtetPaing__ have u config the content in the tailwind.config, I came across a similar problem I found that my config has syntax wrong and everything worked after I fix it.

AungHtetPaing__'s avatar

@jasonlamv-t Thank for the reply. This thread is one year old so I don't remember I solved it or not. But I will give you best answer to close this thread.

Please or to participate in this conversation.