Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
378 views
in Technique[技术] by (71.8m points)

css - SASS Maps:可以将内容导出为CSS属性吗?(SASS Maps: Can I export the contents as CSS properties?)

I am trying to find the most efficient way to output multiple color values from a function.

(我试图找到一种最有效的方法来从一个函数输出多个颜色值。)

The function (will eventually) take the base color and output a color scheme using sass functions (think complementary, tertiary, monochromatic, etc...).

(该函数(最终将采用基本颜色)并使用sass函数(请考虑互补色,第三色,单色等)输出配色方案。)

Here is my code that produces the error

(这是我的代码产生错误)

background-color: #020633, color:b7bced Isn't a valid CSS value

(background-color:#020633,color:b7bced不是有效的CSS值)

I'm sure that I need to replace the comma with a semicolon, I'm just not sure if I can or if I'm going about this properly.

(我确定我需要用分号替换逗号,但是我不确定是否可以或是否要正确处理。)

$base-color: #0a104e;

@function darkest-color($darkest-base-color-bg) {
    //figure the backgound
    $darkest-bg-color: scale-color($darkest-base-color-bg, $saturation: 66%, $lightness: -40%, $alpha: 100%);
    //figure the text
    $darkest-text-color-nocontrast: scale-color($darkest-base-color-bg, $saturation: 66%, $lightness: 40%, $alpha: 100%);
    //figure the contrast between the background and the text
    $darkest-text-color: color_adjust_contrast_AERT($darkest-text-color-nocontrast, $darkest-base-color-bg);
    //add the two colors to a map
    $darkest-color: '';
    @return $darkest-color (background-color: $darkest-bg-color, color:$darkest-text-color, );
}

.darkest-accent-strip {
    content: darkest-color($base-color);
}
  ask by blur translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...