Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 覆盖基础按钮_Css_Sass_Zurb Foundation - Fatal编程技术网

Css 覆盖基础按钮

Css 覆盖基础按钮,css,sass,zurb-foundation,Css,Sass,Zurb Foundation,文档()没有提到任何关于更改按钮背景的内容。如何在sass(custom.scss)中执行此操作 我无法创建新的buttonclass,因为我需要更改Drupal中生成的组件的样式。如果不能创建新类,不能扩展现有类吗 您可以这样做: button, .button, a.button, input.button { background-color: green; } 因为我不能添加评论,所以我将只写它作为一个答案。是否要更改所有按钮的背景色?有一个文件供您自定义这些设置,默认情况下,这些

文档()没有提到任何关于更改按钮背景的内容。如何在sass(custom.scss)中执行此操作


我无法创建新的buttonclass,因为我需要更改Drupal中生成的组件的样式。

如果不能创建新类,不能扩展现有类吗

您可以这样做:

button,
.button,
a.button,
input.button
{
  background-color: green;
}

因为我不能添加评论,所以我将只写它作为一个答案。是否要更改所有按钮的背景色?有一个文件供您自定义这些设置,默认情况下,这些设置会被注释。您会发现一些背景色设置行,如下所示: 在基金会5中,其在<代码>中设置。SCSS < /P>
// $primary-color: #008CBA;
// $secondary-color: #e7e7e7;
// $alert-color: #f04124;
// $success-color: #43AC6A;
// $warning-color: #f08a24;
// $info-color: #a0d3e8;
取消注释要自定义设置的行,并根据需要更改颜色值。在为按钮定义样式的文件中,
@import
具有自定义设置的文件(
\u settings.scss
)。这还将更改导入自定义设置文件的其他元素的颜色

另一种方法是,转到
@mixin按钮的定义,并根据需要更改
$bg
的值

&.secondary { @include button-style($bg:$secondary-color); }
  &.success   { @include button-style($bg:$success-color); }
  &.alert     { @include button-style($bg:$alert-color); }

&.disabled, &[disabled] { @include button-style($bg:$primary-color, $disabled:true);
    &.secondary { @include button-style($bg:$secondary-color, $disabled:true); }
    &.success { @include button-style($bg:$success-color, $disabled:true); }
    &.alert { @include button-style($bg:$alert-color, $disabled:true); }

在SCSS文件中尝试这些属性

$button-background  - Background color of the button.

$button-background-hover - Background color of the button on hover. 

$button-color - Text color of the button.

来源:

这不是基础的方法。