-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vivliostyle CoreでCSSカスタムプロパティ(変数)が利用可能になったらThemeで活用してほしい #67
Comments
SASSベースで変数を使ってレイアウトを調整できるテーマを作成したときに悩まされたのが、ChromeとSafariでは内部的にpxが整数でしか扱われないことでした。 SASSではfloor,ceil,round関数があるので解決できましたが、今のところCSSには存在しないようです。 以下のようにcss wgで議論はあったようですが、結果どうなったのか追えていません。 CSS変数が使えるようになるならとても有り難いですが、必要な関数が無いとcalc()で計算したときに微妙なレイアウトのずれにストレスを貯める人も増えてしまいそうです。 |
10月MTGでのメモ
|
I am curious: What is the status of the CSS variables? Are they still on the roadmap? |
@depth42 Yes, it's on my to-do list. I hope I can complete it during this summer. |
Now, Vivliostyle supports CSS variables! |
Vivliostyle Themeをカスタマイズしやすくするための議論で、Sassの変数をパラメータにすることが検討されてきました(関連issue #19 や #9)。
最近のWebの標準では、CSSカスタムプロパティ(CSS変数)が利用できるようになっているのですが、Vivliostyle Coreでそれが未サポート(Issue: vivliostyle/vivliostyle.js#540 )であるために、Vivliostyle ThemeでのCSSカスタムプロパティの利用は検討されてませんでした。
Vivliostyle CoreではCSSカスタムプロパティを近いうちに(できれば10月にでも)サポートしようと検討中です。
それが使えるようになった場合、Vivliostyle Themeのカスタマイズのしくみに利用するのがよいと思います。
コンパイルが必要なSass変数とは違って、CSSカスタムプロパティはCSSの解釈時にCSSのカスケーディングのしくみにしたがって有効になるので、Vivliostyleでの組版実行時にパラメータをVivliostyle Coreに渡すことがより簡単です。
参考記事: MDN - CSS カスタムプロパティ (変数) の使用
https://developer.mozilla.org/ja/docs/Web/CSS/Using_CSS_custom_properties
The text was updated successfully, but these errors were encountered: