How to add space after a colon in CSS with Sublime Text 2?
Add this line:
{ "keys": [":"], "command": "insert", "args": {"characters": ": "}}
To your .config/sublime-text-2/Packages/User/Default (Linux).sublime-keymap
(in menus: Preferences>Key bindings User
) File. Now everytime you press :
, :
and a space will appear... :)
How to remove extra space after a colon in CSS with Sublime Text 2?
I did some more digging and would like to suggest an alternate solution.
Open
~/Library/Application Support/Sublime Text 2/Packages/CSS/css_completions.py
in Sublime.On line 190, remove the space after the colon:
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.
Fix a CSS file: space after colon on rules but not selectors (Sublime Text 2)
Why creating a regular expression would work very well. I think the easiest and quickest way would be to simple use your IDE's find and replace to add a space after each colon and then use find and replace again to remove the space from your pseudo classes. Since there are probably only around 8 different pseudo classes used it shouldn't take to long to prform a find a replace on each.
How to remove space after a colon in CSS with Sublime Text 3?
First off, let me say that I'm against this for readability reasons - if you want to minify your CSS, there are plenty of tools available to do that within Sublime. That being said, there is a way to do it, but it requires some effort. First, make sure you have Package Control installed. Next, we'll need to extract a file from a .sublime-package
file, so install the PackageResourceViewer
plugin. To do that, once you have Package Control installed and have restarted Sublime, open the Command Palette with CtrlShiftP (⌘ShiftP on OS X) and type pci
into the prompt to bring up the Package Control: Install Package
option. Hit Enter, wait for the repositories to load, then type packresview
to bring up the PackageResourceViewer
option. Hit Enter again, and wait for it to install.
Next, open the Command Palette again, and type prv
to bring up the PackageResourceViewer
options, then select PackageResourceViewer: Open Resource
. Scroll down to CSS
, hit Enter, then scroll down to css_completions.py
and hit Enter again to open it. You can ignore 99% of the file, just scroll down to line 190, which looks like this:
l.append((p, p + ": "))
Just delete the space after the colon :
like so:
l.append((p, p + ":"))
save the file, and you should be all set. You may want to restart Sublime (and reopen all your CSS files) for the full changes to take effect.
Ensure exactly one space after each colon in CSS in Netbeans
Try this search
([a-zA-Z0-9]:)([a-zA-Z0-9#])
And replace it with
$1 $2
How can I modify CSS color sets in Sublime Text 2?
Not sure about the color attribute and value yet, but for the css spacing I may have an answer. Go to C:\Users\<username>\AppData\Roaming\Sublime Text 2\Packages\CSS\css_completions.py
Line 190. Change l.append((p, p + ": "))
to l.append((p, p + ":"))
Related Topics
Font Family Open Sans Not Being Used
Angular2-Cli Gives @Multi Styles Error
Right Corner Ribbon on a Div CSS
Twitter Bootstrap Radio/Checkbox - How to Put Glyphicon
Add Scrollbar on Dropdown Menu Options
CSS Select Dropdown Bold on Some <Option>'s
Overflow: Hidden Behind Padding
Using CSS to Give a Black Icon Another Color
Nuxt & Vuetify: How to Control The Order in Which CSS Files Are Loaded
How to Make Cross Browser Gradient Mixin in Compass, with Ie9, Ie8, Ie7 and Opera
How to Scale an Svg Background-Image Without Honoring Aspect Ratio in Firefox
Opposite of Adjacent Sibling Selector
Put Title/Alt Attributes into CSS: After { Content: Image }
Mvc Bundling and Relative CSS Image When Website Is Deployed to an Application
Floated Divs Obeying/Not Obeying Vertical-Align
Use Flexbox and Maintain an Aspect Ratio Even Though Content Is Sized Differently