Skip to content

Instantly share code, notes, and snippets.

@joshuaiz
Last active February 9, 2018 05:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuaiz/98a8bdbfaf185409981ab3b37871f68e to your computer and use it in GitHub Desktop.
Save joshuaiz/98a8bdbfaf185409981ab3b37871f68e to your computer and use it in GitHub Desktop.
Sublime liquid sass/scss interpolation. Use this to select elements in a scss.liquid file and use sass interpolation to escape them so you can use a preprocessor.
<!-- Save to ~/Library/Application Support/Sublime Text 3/Packages/User/ -->
<!-- Example: if you have some liquid like: {{ settings.site_bg_col }}; in your .scss.liquid file,
select that (except for the closing ; and use the keybinding set below. -->
<!-- Output: #{" {{ settings.site_bg_col }} "}; -->
<snippet>
<content><![CDATA[
#{" $SELECTION "}
]]></content>
<!-- this tab trigger won't really work when using $SELECTION -->
<tabTrigger>sslq</tabTrigger>
<description>SCSS Liquid Interpolation</description>
</snippet>
// Add this to Sublime Text > Preferences > Key Bindings
{
"keys": ["shift+control+l"], // change this to whatever you want
"command": "insert_snippet",
"args": { "name": "Packages/User/liquidsass.sublime-snippet" }
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment