-
Notifications
You must be signed in to change notification settings - Fork 0
Imports
Carl Calderon edited this page Jun 15, 2013
·
2 revisions
What would a preprocessor be without imports? Of course liten supports them! And it's clever too.
Imports are defined using @import
statements like so: @import "head"
. In this particular case liten will search for "head"
in the directory where the current file (which is doing the import) is located. You don't even have to type "head.liten"
. liten will do that for you!
mixins.liten:
=bold($text)
strong:$text
Input:
@import "mixins"
html
body
+bold("foo")
+bold("bar")
Output:
<html>
<body>
<strong>foo</strong>
<strong>bar</strong>
</body>
</html>
Imports are included directly where you place them making it easy to include a set of variablesor an external set of liten files within a local scope.
@import "my_global_things"
html
head
title:$TITLE_FROM_MY_GLOBAL_THINGS
@import "FacebookMetaData"
body
@import "page_body"