question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tailwind adds space after a colon for paged media (print css)

See original GitHub issue

What version of Tailwind CSS are you using? 3.1.8

What build tool (or framework if it abstracts the build tool) are you using? postcss-cli

What version of Node.js are you using? v18.9.1

What browser are you using? Chrome

What operating system are you using? macOS

Reproduction URL https://play.tailwindcss.com/gF6jqBljqr?file=css

Describe your issue

VSCode inserts a space after a colon for paged media.

For example, the below could should not have space between : & first

@page: first{
  size: 5.5in 8.5in;
  margin: 0;
}

It should look like:

@page:first {
  size: 5.5in 8.5in;
  margin: 0;
}

If you open the Tailwind Play & click Tidy on CSS tab, you will see how it gets formatted.

This has been discussed before but those solutions don’t work for me. Probably, because I’m using Paged Media.

I tried inserting the following in .vscode/settings.json:

{
  "files.associations": {
    "*.css": "tailwindcss"
  }
}

But it didn’t work.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
adamwathancommented, Oct 12, 2022

Looks like it’s actually fine, you just need to write it with a space after @page.

Here’s the example from MDN:

image

Does that work with Prince? Prettier handles it properly if you write it that way anyways 👍

0reactions
deadcoder0904commented, Oct 13, 2022

can confirm, that works with prince & prettier formats it correctly. thanks adam 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode on Save adding space after colon (:) #6284 - GitHub
I found a "cleaner" solution in the official TailwindCSS VSCode Extension readme – to associate all css files as tailwindcss files. By just...
Read more >
Space Between - Tailwind CSS
Add horizontal space between children. Control the horizontal space between elements using the space-x-{amount} utilities.
Read more >
Complete Tailwind CSS Tutorial - YouTube
In this video, we'll be setting up Tailwind, going over fonts, colors, alignment, background colors, gradients, images, padding, margin, ...
Read more >
Adding a space after colon using CSS and HTML
That's simple, just add   after the colon, like this : <li><strong>Total number of students:  </strong>30</li>. Run code snippet
Read more >
List of CSS features required for paged media - W3C
Printing marks; Bookmarks for PDF; Styling blank pages; Page sequence direction in interactive media; Float margins; Page size ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found