-
-
Notifications
You must be signed in to change notification settings - Fork 501
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
Feature request: Pretty mode and whitespaces #594
Comments
Hi @PeterMozesMerl I believe we ran into the same problem. We customized the config for our development Env now so it will behave like Staging/Production again. But I want to point out that it is highly annoying when I cannot rely on my Dev-Env to behave the same way as my Production Env. In our case the layout for an important part of the website broke in Dev because we use In my opinion the default config should be change again so all Envs behave the same way. Which would be the (sometimes annoying) slim-way to remove all whitespaces everywhere except for when I tell it not to (with Tobias |
@tordans Please ask slim-rails to change it back or create a short poll there. |
@tordans I have the same problem using |
@phlegx we just reset the option in our app so all environments behave the same. |
I deactivated it again in slim-rails master. |
(Comment edited) |
As far as I understood Slim adds whitespaces in pretty mode "only where it doesn’t matter". This is true unless you are using CSS to change display defaults.
Look at the following code:
The first and the second series of numbers are rendered the same way in development and in production mode. (Compared to themselves of course. The divs will be rendered in new lines and the spans will be rendered in a single line.)
The third series aren’t rendered the same way. There will be a space between them in development.
This makes the pretty mode more or less useless as soon as you have a layout with inline-block elements. Which is completely valid and sometimes better than having floating elements. I am not aware of any other solution than turning off pretty in development mode. (However, I am new to Slim).
It depends on the specific layout how much a small space will break it, but speaking about design more than zero difference is usually too much.
Since Slim can’t tell which elements’ displays are changed from the default, the solution might be to add an option to tell Slim "Please, do not add white spaces after this tag whatever you think about it. Thank you."
What do you think?
The text was updated successfully, but these errors were encountered: