Skip to content
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

[要望] style属性からClassName属性への移行 #185

Closed
cwtickle opened this issue Feb 9, 2019 · 4 comments
Closed

[要望] style属性からClassName属性への移行 #185

cwtickle opened this issue Feb 9, 2019 · 4 comments

Comments

@cwtickle
Copy link
Owner

cwtickle commented Feb 9, 2019

Is your feature request related to a problem? Please describe.
現行のDan★Oniソースでは実装優先の事情により、
オブジェクトに対してstyle属性により直接スタイルシートの中身を書き換えています。
このやり方では、将来的なデザイン変更に対応しづらくなる可能性があります。

Describe the solution you'd like
将来的なスキン変更を見込み、
style属性を直接書き換える部分を、段階的にCSSのclassNameへ移行させ、
できるだけClassNameを使用する実装に置き換えます。

Describe alternatives you've considered
既存関数は互換性維持のため当面残します。
メジャーバージョンアップの際に関数の改廃を検討することとします。

Additional context
現状、Canvasのwidth/heightのサイズを使用している箇所があります。
具体的には、ボタンの横サイズ、曲名クレジット表示位置などのX/Y座標やサイズです。
この部分は動的に変えるしかないため、例外的にstyle属性を残す方向とします。

@cwtickle cwtickle changed the title [要望] style情報のcssファイル移行 [要望] style属性からClassName属性への移行 Feb 9, 2019
@suzme
Copy link
Contributor

suzme commented Feb 9, 2019

サイズに関してはcalcで計算したり、flexで分割する等で対応できると思います。
座標もrightやbottomを使えば動的に変更しなくて済むのではないでしょうか。

@cwtickle
Copy link
Owner Author

確認できていませんでした。すみません。
確かに極力rightを使ったり、calcを使えば回避はできそうですね。
現在は画面をセンタリングする都合で、canvasのwidthやheightを使っていますが
うまくそういった関数が併用できるなら、いくらか回避できるかもしれません。

@cwtickle
Copy link
Owner Author

この件ですが、次のver10での実装を予定しています。
ClassName属性では複数クラスが扱いにくい点があるため、基本はclassListを使用します。

動的に変わるところまでcssに持っていくことはできませんが、色や一部オブジェクトのサイズ、座標なら可能だと思っています。

@cwtickle
Copy link
Owner Author

cwtickle commented Nov 4, 2019

v10.0.0のスキン実装に伴い、多くの直指定を改善しました。
Canvasも未使用にできたので、このIssueとしてはクローズします。

@cwtickle cwtickle closed this as completed Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants