简体   繁体   English

Sass打破@extend“.bg-faded”

[英]Sass is breaking on @extend “.bg-faded”

I used Rails Composer to create a skeleton application for the rails-devise-roles project described here: 我使用Rails Composer为这里描述的rails-devise-roles项目创建一个框架应用程序:

https://github.com/RailsApps/rails-devise-roles https://github.com/RailsApps/rails-devise-roles

I'm getting a 500 error generated by the following: 我收到由以下内容生成的500错误:

Sass::SyntaxError - ".authform form" failed to @extend ".bg-faded".
The selector ".bg-faded" was not found.
Use "@extend .bg-faded !optional" if the extend should be able to fail.

Adding the "!optional" flag allows it to render, but none of the navigation links are then displayed. 添加“!optional”标志允许它进行渲染,但不会显示任何导航链接。

Contents of my Gemfile are displayed below: 我的Gemfile的内容显示如下:

source 'https://rubygems.org'
git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end
ruby '2.2.5'
gem 'rails', '~> 5.1.3'
gem 'sqlite3'
gem 'puma', '~> 3.7'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
group :development, :test do
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'
end
group :development do
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'bootstrap', '~> 4.0.0.alpha6'
gem 'devise'
gem 'high_voltage'
gem 'jquery-rails'
gem 'unicorn'
gem 'unicorn-rails'
group :development do
  gem 'better_errors'
  gem 'rails_layout'
  gem 'spring-commands-rspec'
end
group :development, :test do
  gem 'factory_girl_rails'
  gem 'faker'
  gem 'rspec-rails'
end
group :test do
  gem 'database_cleaner'
  gem 'launchy'
end

Thoughts? 思考?

@extend .bg-faded @extend .bg-light更改为@extend .bg-light将修复您的错误

Its most likely because you haven't imported the framework CSS. 最有可能的原因是你没有导入框架CSS。 Add these to your application.scss file 将这些添加到您的application.scss文件中

// import the CSS framework
@import "bootstrap"; 

将gemfile中的bootstrap行更改为gem'bootstrap gem 'bootstrap', '= 4.0.0.alpha6'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM