• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

最近はslimを押してますが、haml中のsassフィルタでインターポレーションを行う方法のメモです。

sassフィルタってのはこんなやつです。

haml>>
head
%style{type="text/css"}
:sass
body
background: #FFF
<<--

インターポレーションには#{ }を使いますが、これがhamlの記法とバッティングしてるので#をエスケープする必要があります。

haml>>
head
%style{type="text/css"}
:sass
@mixin opacity($a)
$A: $a * 100
opacity: $a
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=#{'#'}{$A})"
filter: alpha(opacity=$A)
<<--

こんな感じです。

posted by genki genki on Fri 30 Nov 2012 at 22:49 with 0 comments