LoginSignup
1
1

More than 5 years have passed since last update.

sanitize.cssを使っているとChromeでinputに入力時に文字が消える

Last updated at Posted at 2016-05-05

OSX + Chromeでinputエリアで入力して変換しようとするとこんなんなる。

スクリーンショット 2016-05-05 15.26.23.png

どうも::selection要素が悪さをしているらしい。

::selectionって何よって、調べてみたら非標準な疑似要素らしい。
https://developer.mozilla.org/ja/docs/Web/CSS/::selection

該当するCSSを削除するかcolorを#000000にすると解消する。(適当)

sanitize.css
/* specify the background color, font color, and drop shadow of text selections */

::-moz-selection {
    background-color: #b3d4fc; /* required when declaring ::selection */
    color: #ffffff;
    text-shadow: none;
}

::selection {
    background-color: #b3d4fc; /* required when declaring ::selection */
    color: #ffffff;
    text-shadow: none;
}
1
1
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
1