LoginSignup
0
0

私のreset.css(編集中)

Last updated at Posted at 2024-04-25

後日記載します。

私のreset.css

・ios対応reset.css

:where([hidden]:not([hidden='until-found'])) {
	display: none !important;  /* hiddenは非表示を意味します */
}
 
:where(html) {
	-webkit-text-size-adjust: none; /* iOSのランドスケープでテキストが調整されないようにする */
	color-scheme: dark light; /* ユーザーがダークテーマを好む場合、自動的にダークテーマになる */
}
 
@supports not (min-block-size: 100dvb) {
	:where(html) {
		block-size: 100%;
	}
}
 
@media (prefers-reduced-motion: no-preference) {
	:where(html:focus-within) {
		scroll-behavior: smooth; /* 何かにフォーカスがある場合のみスムーズスクロール */
	}
}
 
:where(body) {
	block-size: 100%; /* サファリ以外のブラウザのフォールバック */
	block-size: 100dvb; /* 1dvbは動的ビューポートの長さの1%、100dvbで高さいっぱいに */
	line-height: 1.5; /* アクセシブルな行の高さ */
	font-family: system-ui, sans-serif; /* timeの代わりにシステムフォントを使用 */
	-webkit-font-smoothing: antialiased; /* テキストのレンダリングを改善 */
}
 
:where(input, button, textarea, select) {
	font: inherit; /* フォーム コントロールは親フォントを継承 */
	color: inherit; /* カラーも継承 */
}
 
:where(textarea) {
	resize: vertical; /* テキストエリアの水平リサイズを無効に */
	resize: block;
}
 
:where(button, label, select, summary, [role='button'], [role='option']) {
	cursor: pointer; /* インタラクティブなものにカーソルを合わせる */
}
 
:where(:disabled) {
	cursor: not-allowed; /* フォームコントロール無効時のカーソルを許可しない */
}
 
:where(label:has(> input:disabled), label:has(+ input:disabled)) {
	cursor: not-allowed; /* ラベルにもカーソルを許可しない */
}
 
:where(button) {
	border-style: solid; /* ボタンのボーダーのスタイルを設定しやすくする */
}
 
:where(a) {
	text-underline-offset: 0.2ex; /* 下線の上にスペースを追加する */
}
 
:where(ul, ol) {
	list-style: none; /* ビュレットを削除、必要に応じて手動で追加する */
}
 
:where(img, svg, video, canvas, audio, iframe, embed, object) {
	display: block; /* 置換された要素をより予測可能にする */
}
 
:where(img, picture, svg) {
	max-inline-size: 100%; /* images should never overflow past the available space */
	block-size: auto; /* アスペクト比を保持 */
}
 
:where(p, h1, h2, h3, h4, h5, h6) {
	overflow-wrap: break-word; /* 長い単語は改行 */
}
 
:where(h1, h2, h3) {
	line-height: calc(1em + 0.5rem); /* 見出しの行の高さを減らす */
}
 
:where(hr) { /* より一貫性のある、スタイリッシュなhr */
	border: none;
	border-block-start: 1px solid;
	color: inherit;
	block-size: 0;
	overflow: visible;
}
 
:where(:focus-visible) { /* より一貫性のある、カスタマイズ可能なフォーカスのアウトライン */
	outline: 2px solid var(--focus-color, Highlight);
	outline-offset: 2px;
}
 
 /* .visually-hiddenは後のカスケードレイヤーを上書きするために!importantを使用 */
:where(.visually-hidden:not(:focus, :active, :focus-within, .not-visually-hidden)) {
	clip-path: inset(50%) !important;
	height: 1px !important;
	width: 1px !important;
	overflow: hidden !important;
	position: absolute !important;
	white-space: nowrap !important;
	border: 0 !important;
}

 
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