亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

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

您好,我遇到以下問題:

“定義 CSS 顏色時(shí)需要 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

全部回復(fù)(1)
P粉920199761

CSS 驗(yàn)證器似乎有某種錯(cuò)誤。如果您刪除 /* Color Variables */ 注釋或注釋本身之前的空格,它會(huì)向您顯示錯(cuò)誤 - 正如它應(yīng)該的那樣,因?yàn)檫@不是 CSS。

您正在使用 Sass 變量、規(guī)則語法和函數(shù)。您應(yīng)該將文件命名為 style.scss 而不是 style.css 來向大多數(shù)工具表明您的意圖,如果您尚未配置 Sass 構(gòu)建,則需要要做到這一點(diǎn)。具體如何取決于您的工具的其余部分,但無論如何,都會(huì)有一個(gè)插件(例如 webpack 的 sass 加載器)。

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