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

Allow outputting correct formatting with media queries #290

Closed
nwmcsween opened this issue Jun 3, 2017 · 5 comments
Closed

Allow outputting correct formatting with media queries #290

nwmcsween opened this issue Jun 3, 2017 · 5 comments

Comments

@nwmcsween
Copy link

nwmcsween commented Jun 3, 2017

Example:

importfile.css:

@import 'somefile.css' (min-width: 36em);`

somefile.css:

.select {
  foo: bar;
}

Output:

@media (min-width:36em){
.select {
 foo: bar;
}
}

Desired output:

@media (min-width:36em) {
  .select {
   foo: bar;
  }
}
@RyanZim
Copy link
Collaborator

RyanZim commented Jun 3, 2017

Yeah, if this doesn't require a huge amount of changes (or really hurt performance), PR welcome. I'm personally not motivated to fix this since I always run the output through a minifier anyhow.

@RyanZim
Copy link
Collaborator

RyanZim commented Mar 22, 2022

Since #483; this also applies to @layer support.

@romainmenke
Copy link
Collaborator

We've had similar requests for nested css transforms and decided not to implement any kind of formatting.

Formatting is best left up to linters.

Any attempt to resolve this here would end up re-implementing a full blown linter with all the user preferences. (tabs vs. spaces, where to start newlines, ...)

@romainmenke
Copy link
Collaborator

romainmenke commented Jul 23, 2023

@nwmcsween You can add a pretty printer plugin later in your PostCSS plugins config.

This seems to do exactly what you want : https://www.npmjs.com/package/postcss-prettify

@RyanZim
Copy link
Collaborator

RyanZim commented Jul 24, 2023

Yeah, I'm going to close this as out of scope.

@RyanZim RyanZim closed this as completed Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants