Home Download Buy Blog Forum Support

Zen Coding css properties with no spaces

Zen Coding css properties with no spaces

Postby Sikwel on Sat May 05, 2012 3:24 pm

Is it possible to expand Zen Coding css properties with no spaces after colon?

By default:
Code: Select all
.some-class {
   position: absolute;
   }

Necessary:
Code: Select all
.some-class {
   position:absolute;
   }
Sikwel
 
Posts: 7
Joined: Sat May 05, 2012 11:19 am

Re: Zen Coding css properties with no spaces

Postby jackyyll on Sat May 05, 2012 5:16 pm

I'm almost sure that zen coding doesn't use spaces after colons by default. I had to edit my zen coding plugin to add the spaces after them, as that's what i prefer.
jackyyll
 
Posts: 2
Joined: Fri Mar 16, 2012 1:09 am

Re: Zen Coding css properties with no spaces

Postby Sikwel on Sat May 05, 2012 8:53 pm

It's very strange, because I have latest version of Sublime Text 2 and just two days ago I'd installed Zen Coding with Sublime Package Control. And this Zen Coding plugin really inserts spaces after colon in css properties.

Say me please, where and how you'd edited Zen Coding plugin, maybe I can delete space inserting in a same way like you'd added spaces.
Sikwel
 
Posts: 7
Joined: Sat May 05, 2012 11:19 am

Re: Zen Coding css properties with no spaces

Postby skube on Sun May 06, 2012 8:16 pm

Is it Zen Coding plugin or ST2 itself that is adding a space?
skube
 
Posts: 86
Joined: Tue Feb 28, 2012 8:42 pm

Re: Zen Coding css properties with no spaces

Postby Sikwel on Mon May 07, 2012 10:36 am

It's definitely Zen Coding plugin, because it's abbreviations of this plugin. Or am I wrong? Then if ST2 may do that, how I can switch off this setting? Or is it impossible?
Sikwel
 
Posts: 7
Joined: Sat May 05, 2012 11:19 am

Re: Zen Coding css properties with no spaces

Postby pietvanzoen on Thu Jul 12, 2012 5:39 pm

I've also been experiencing this problem. I think it started after the last Sublime update.

It seems like sublime or something within zen coding is adding a space before placeholders.

For example, c and tab results in:
Code: Select all
color: # 000000

With ' 000000' being selected. Note the space between the # and the hex code.
pietvanzoen
 
Posts: 2
Joined: Thu Jul 12, 2012 4:44 pm

Re: Zen Coding css properties with no spaces

Postby deej on Thu Feb 21, 2013 6:55 pm

Has anyone been able to accomplish removing the whitespace between css properties and values? With or without Zen Coding/Hayaku?

It seems a very basic thing to control but I've been unable to find a solution in layman's terms.

Edit: Found a solution:

Open ~/Library/Application Support/Sublime Text 2/Packages/CSS/css_completions.py in Sublime.

On line 190, remove the space after the colon:

Code: Select all
l.append((p, p + ": "))

The only caveat I can think of is that this might get overwritten when you update Sublime, but this seemed to work great without installing an extra package.

Source

Exactly what I was looking for, but as they say, it will be overwritten with any updates.
deej
 
Posts: 1
Joined: Thu Feb 21, 2013 6:51 pm

Re: Zen Coding css properties with no spaces

Postby bcoyour on Tue Jan 21, 2014 3:37 am

Not to bring up an old issue, but does anyone have a solution for removing the extra blank space after all CSS styles in Sublime Text 3? The solution above does not work in Sublime Text 3. It's such a small thing but it drives me crazy.

Thanks!
bcoyour
 
Posts: 5
Joined: Tue Jan 21, 2014 3:33 am

Re: Zen Coding css properties with no spaces

Postby jmaker on Thu Jan 23, 2014 3:31 am

Yes, very simple. I assume everyone's using Emmet by now.

Add this:

Code: Select all
"preferences": {
         "css.valueSeparator": ":"
}


Inside of your Emmet user settings file. That will only insert the colon instead of colon and space.
jmaker
 
Posts: 5
Joined: Fri Jan 11, 2013 12:08 am

Re: Zen Coding css properties with no spaces

Postby bcoyour on Thu Jan 23, 2014 3:53 pm

Thanks for the response. Yes, I do have Emmet installed and I have updated that preference. That does fix the issue with all the Emmet autocompletions, so thank you!

Do you know with a standard autocomplete like padding or margin that is not part of Emmet how to stop it from adding the space after the colon? Try typing "pad" and hitting tab in a CSS file and you'll still get "padding: " with the space after the colon. Do you get the same results?

Thank you!
bcoyour
 
Posts: 5
Joined: Tue Jan 21, 2014 3:33 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 17 guests