国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

CSS 顏色變數(shù) - 定義 CSS 顏色時需要規(guī)則或選擇器
P粉021708275
P粉021708275 2023-09-13 11:02:07
0
1
856

您好,我遇到以下問題:

「定義 CSS 顏色時需要 at-rule 或選擇器。」

我正在使用 VS 程式碼,並且我已在 https://jigsaw.w3.org/css-validator/validator#css 檢查了 CSS

我不知道問題出在哪裡!

/* Color Variables */
$red: red;
$green: green;
$orange: orange;
$blue: blue;
$purple: purple;
$white: white;
$black: black;
$bg: /* #eff3f6 */ #e3e5e6;
$darkgray-blue: #354052;
$lightgray-blue: #7f8fa4;

/* Styles */
body {
  background: $bg;
  font-family: 'Roboto', sans-serif;
  letter-spacing: 1px;
}

.text-red {color: $red !important;}
.text-green {color: $green !important;}
.text-orange {color: $orange !important;}
.text-blue {color: $blue !important;}

/* buttons */
.btn-red {
  background: $red;
  color: $white;
  font-size: xx-small;
  &:hover, &:focus {
    background: darken($red, 8%);
    color: white;
  }

P粉021708275
P粉021708275

全部回覆(1)
P粉920199761

CSS 驗證器似乎有某種錯誤。如果您刪除 /* Color Variables */ 註解或註解本身之前的空格,它會向您顯示錯誤 - 正如它應該的那樣,因為這不是 CSS。

您正在使用 Sass 變數(shù)、規(guī)則語法和函數(shù)。您應該將文件命名為style.scss 而不是style.css 來向大多數(shù)工具表明您的意圖,如果您尚未配置Sass 構建,則需要要做到這一點。具體如何取決於您的工具的其餘部分,但無論如何,都會有一個外掛程式(例如 webpack 的 sass 載入器)。

最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板