1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Vuetifyのデフォルトのフォントサイズを変更する

Last updated at Posted at 2019-10-16

やりたかったこと

ブラウザのフォントサイズの設定に合わせて、文字サイズが変わるサイトにしたかった。
スクリーンショット 2019-10-16 16.54.47.png
何もしないとブラウザの設定を変更しても文字サイズは同じまま。

原因

Vuetifyがデフォルトでhtmlに対してフォントサイズを設定していた

html {
    font-size: 16px; 👈
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

解決策

index.html の html要素に直接指定して書き換える

public/index.html
<!DOCTYPE html>
<html lang="ja" style="font-size:initial;"> 👈
     (略)
</html>

一部書き換わってくれないコンポーネントがありましたが、
今回は気にならない部分だったのでとりあえずこれでよし。

1
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?