Home Download Buy Blog Forum Support

Snippets in CSS

Snippets in CSS

Postby Giuliano on Fri Sep 03, 2010 7:10 pm

Hi guys,

This is probably easy for most of you but I can't make this thing work. I have a snippet I want to use inside CSS file. This snippet just add a comment that I'm using as divider. Snippet is saved inside "User" folder. This is the code:

Code: Select all
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
   <content><![CDATA[
/* ${1:Add comment title here}
---------------------------------------------*/

$0
]]></content>
   <!-- Optional: Tab trigger to activate the snippet -->
   <tabTrigger>csst</tabTrigger>
   <!-- Optional: Description to show in the menu -->   
   <description>CSS comment title</description>
</snippet>

Now, this snippet works inside HTML file, and also works inside CSS file when I type "csst+tab" inside brackets like this: .test {csst+tab}. But, I actually need this to add comment outside class. How I can make this work?

Thanks!
Giuliano
 
Posts: 2
Joined: Fri Sep 03, 2010 5:21 pm

Re: Snippets in CSS

Postby jps on Sun Sep 05, 2010 12:51 am

Because there's no <scope> element in the snippet, it should work everywhere.

Keep in mind that snippets in Sublime Text are triggered via key bindings: you have to type exactly c,s,s,t,tab without using backspace etc.
jps
Site Admin
 
Posts: 3058
Joined: Wed Mar 19, 2008 12:33 pm

Re: Snippets in CSS

Postby Giuliano on Tue Sep 07, 2010 1:25 pm

Hi jps, thanks for reply. As I described this snippet works in CSS file too but only when it's triggered between brackets { }. I need this to work outside brackets, at a beginning of the CSS document for example or in between classes, not inside.
Giuliano
 
Posts: 2
Joined: Fri Sep 03, 2010 5:21 pm

Re: Snippets in CSS

Postby edenchen on Wed Jan 29, 2014 10:10 am

did you ever find a solution to this? still having this same problem
edenchen
 
Posts: 1
Joined: Wed Jan 29, 2014 10:09 am


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 8 guests

cron