0
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 1 year has passed since last update.

inputタグに自動で付与されるアイコンを独自に変更する方法

Posted at

サンプルコード

sample.css
input[type='time'] {
  position: relative;
}

input[type='time']:after {
  font-family: FontAwesome;
  content: '\f017';
  color: #fff;
  padding: 0 5px;
}
input[type='time']::-webkit-calendar-picker-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  height: auto;
  color: transparent;
  background: transparent;
  z-index: 100;
}

結果

image.png

用途

背景が黒の上にinputタグを置く場合ですね。
ダークモード対応なんかに使えそう。

需要としてはあまりにニッチだし、アイコンを意識的に変えるってことはしないとは思う。
ただ引き出しを持っておくと何かの拍子で使えるかもしれない。

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