Skip to content

For those who are tabs people like me #2157

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

Closed
octopusinvitro opened this issue Aug 20, 2014 · 10 comments
Closed

For those who are tabs people like me #2157

octopusinvitro opened this issue Aug 20, 2014 · 10 comments

Comments

@octopusinvitro
Copy link

I've searched the issues but seems like nobody asked this.

I use tabs for indentation and spaces for aligning. When I run lessc, the output css uses spaces for indentation and for aligning. Is there any way (or modifier maybe?) to change the output so that it uses tabs for indentation and spaces for aligning?

Cheers!

@lukeapage
Copy link
Member

Not at the moment

@lukeapage
Copy link
Member

I wonder why you need it - do you edit your output css files?

@seven-phases-max
Copy link
Member

I guess you should take a look at some "post-formatting" tool like csscomb.

@seven-phases-max
Copy link
Member

@lukeapage It looks like we have now a lot of open issues for "preserve source formatting" (incl. those for comments) that mostly overlap each other. I feel like we can just merge all of them into some unified feature request: "total source formatting preserve" (incl. line-breaks) for further discussion and decisions (with #2099 (comment) as a starting point and probably marked for v3 :)

@lukeapage
Copy link
Member

I was thinking about it recently and I don't know how you'd do it e.g.

.mixin() {
  color: red;
}
.a {
   .b {
      display: none;
      .mixin();
   }
}

becomes

.a
  .b {
    display: none;
  color: red;
  }

so I actually think there are 2 requirements

  1. output formatting options (prob. not too difficult)
  2. guess formatting options from input - if this was just tabs vs spaces and a few other things, again not too difficult.

Demand for (2) would probably dissipate if we allowed (1) so I'm thinking (1) is probably the way to go.

and I was wondering how difficult it would be to seperate out the toCSS into a visitor - then you could have the simple one and a plugin that was more complicated and did formatting (and if the nodes contained whitespace and someone wanted to write a output module that tried to preseve output they could.

If you have the time/feel like combining issues or closing duplicates then just go for it.

@seven-phases-max
Copy link
Member

For your example I guess we'll just need to apply mixin call whitespaces to its contents (not counting that this has another trickery with "before or after" stuff).


output formatting options (prob. not too difficult)

And they will never be happy unless we have a dedicated flag for each tiny dot or comma (e.g.). Assuming this I'm starting to feel like having a csscomb plugin (just like those for autoprefixer or clean-css or something like that) is a way to go (though it won't solve comment issues).

@lukeapage
Copy link
Member

@seven-phases-max that might be the most pragmatic thing to do

@matthew-dean
Copy link
Member

Yeah, I don't know that "preserve source formatting" is wise (because they aren't the same before/after code), so much as post-format / output plugins, as mentioned.

@seven-phases-max
Copy link
Member

In other words probably we can reject this feature at least: i.e. if we have --tabs than we would also have to have --spaces:n etc etc. and it never will stop :). So all or nothing.

@lukeapage
Copy link
Member

merging to #2176

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

4 participants