gpt4 book ai didi

stylesheet - scss 样式表问题 rails 3.1

转载 作者:行者123 更新时间:2023-12-02 02:22:21 26 4
gpt4 key购买 nike

我的 projects.css.scss 文件如下所示,

// Place all the styles related to the Projects controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

$right-container-background: #3BBFCE;
$right-container-padding: 2px;

.right-container{
background-color: $right-container-background;
color: white;
padding-left: $right-container-padding;
padding-right: $right-container-padding;
}

它说所有样式都将自动添加到您的 application.css 中。

但是如果不导入 application.css 我就无法使用它即

@charset "utf-8";
@import "projects.css.scss";
@import "partners.css.scss";

那么,当我在 View 的项目部分时,它不会加载 application.css 中导入的所有 .scss 文件吗?

最佳答案

rails 3.1 中默认的 application.css 包含以下几行:

/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require_tree .
*/

如果您想要包含所有内容的默认行为,您应该重新添加它们。

关于stylesheet - scss 样式表问题 rails 3.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7556260/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com