LoginSignup
1
3

More than 5 years have passed since last update.

Riot Pug Sass Typescriptで楽にWebページ・アプリを開発 (何が便利か編)[Riot編]

Last updated at Posted at 2017-10-28

親記事

主要な機能

tagを自作できる。
tag内で構造(HTML)とスタイル(CSS)を同一次元で管理できる。

従来のHTMLとの比較

HTML

<!DOCTYPE html>
<html>
  <head>
    <title>hoge</title>
  </head>
  <body>
    <div class="item">
      <p class="big" style="font-size: 1.5em;">huga</p>
    </div>
    <div class="item">
      <p class="big" style="font-size: 1.5em;">moge</p>
    </div>
    <div class="item">
      <p class="big" style="font-size: 1.5em;">ohyo</p>
    </div>
  </body>
</html>

Riot

index.pug
doctype html
html
  head
    title hoge
  body
    item(text="huge")
    item(text="moge")
    item(text="ohyo")
item.tag
item
  p.big {text}

  script.
    import riot from "riot"
    this.text = opts.text

  style.
    .big
      font-size: 1.5em

比較考察

きれいにモジュール化できて楽に開発できそうです。

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3