Skip to content

Commit

Permalink
Added formatter for font-face css feature. (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
gdotdesign committed Sep 19, 2023
1 parent 56185e5 commit dcf97cf
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/formatters/font_face
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
component Main {
style main {
@font-face {
color: red;
}
}

fun render {
<div::main/>
}
}
--------------------------------------------------------------------------------
component Main {
style main {
@font-face {
color: red;
}
}

fun render {
<div::main/>
}
}
10 changes: 10 additions & 0 deletions src/formatters/css_font_face.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module Mint
class Formatter
def format(node : Ast::CssFontFace) : String
body =
list node.definitions

"@font-face {\n#{indent(body)}\n}"
end
end
end

0 comments on commit dcf97cf

Please sign in to comment.