Sublime Forum

How do i make css snippets work outside selector brackets

#1

If i have a snippet save as a css snippet , like below;

`<snippet>
	<content><![CDATA[
/* =============================== */
		  /* ${1:this} */
/* =============================== */
]]></content>
	<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
	<tabTrigger>css-comment</tabTrigger>
	<!-- Optional: Set a scope to limit where the snippet will trigger -->
	<scope>source.css</scope>
</snippet>

Now this only works in my css file if i do:

someElement {
   // it works only inside here.
}

How do i make the above work anywhere inside my css file ? not just inside selector brackets ?

`

0 Likes

#2

If you remove the source.css from the <scope> tag it will enable you to place it anywhere. However, you need to save the file at least once to enable the tabTrigger to appear upon typing.

0 Likes

#3

@badabingbreda , but that will make it global … !!

0 Likes

#4

The reason for why this isn’t working is outlined here: https://github.com/SublimeTextIssues/DefaultPackages/issues/79

1 Like

#5

@FichteFoll priceless thanks :slight_smile:

0 Likes