ホームページ >ウェブフロントエンド >CSSチュートリアル >CSS「装飾」
この記事では、「CSS「装飾」デコレータ」(プロセッサディレクティブを含むCSS「装飾」コメント)と、左から左(RTL)言語とコードのフォーマットの処理における使用について説明します。明確さと改善されたフローのためにそれを言い換えましょう。
この記事は、WikipediaのCommon.CSS「装飾」からのCSS「装飾」のスニペットを調べることから始まります。
.mw-collapsible-leftside-toggle .mw-collapsible-toggle { / * @noflip */ フロート:左; / * @noflip */ テキストアライグ:左; }
The author questions the purpose of /* @noflip */
, identifying it as a CSS「装飾」 decorator, essentially a comment with programmatic functionality.この機能は、RTLスタイルシートを生成するCssjanus(Wikimediaが使用)のようなツールによって処理された場合にのみ現れます。 In this case, float: left
becomes float: right
, and text-align: left
becomes text-align: right
.
The author suggests that using text-align: start
is a more modern and robust approach for handling text alignment in RTL contexts, eliminating the need for CSS「装飾」 processing. While there's no direct equivalent for float
, layout refactoring (potentially using CSS「装飾」 Grid) might offer a solution.
The article then explores the history of CSS「装飾」 processors for RTL conversion, mentioning CSS「装飾」Janus, the now-archived css-flip
, and the deprecated postcss-rtl
. These tools highlight the extensive list of CSS「装飾」 properties requiring adjustments for RTL support (including float
, text-align
, margin
, padding
, and many more).
The author concludes by introducing another common CSS「装飾」 decorator: /* prettier-ignore */
.この指令により、きれいなコードフォーマッタが手動でフォーマットされたCSS「装飾」を変更することを防ぎ、著者の好みのスタイルを維持します。この記事は、読者にプロジェクトでCSS「装飾」デコレータの使用について尋ねることで終了します。
以上がCSS「装飾」の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。