twbs/bootstrap-rubygem hiện có 2.0k sao trên GitHub, viết chủ yếu bằng SCSS. Bootstrap rubygem for Rails / Sprockets / Hanami / etc
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Bootstrap 5 ruby gem for Ruby on Rails (Sprockets/Importmaps) and Hanami (formerly Lotus).
For Sass versions of Bootstrap 3 and 2 see bootstrap-sass instead.
Ruby on Rails Note: Newer releases of Rails have added additional ways for
assets to be processed. The twbs/bootstrap-rubygem is for use with Importmaps
or Sprockets, but not Webpack.
Installation
Please see the appropriate guide for your environment of choice:
Ruby on Rails 4+ or other Sprockets environment.
Other Ruby frameworks not on Rails.
a. Ruby on Rails
Add bootstrap to your Gemfile:
gem 'bootstrap', '~> 5.3.8'
This gem requires a Sass engine, so make sure you have one of these gems in your Gemfile:
dartsass-sprockets: Dart Sass engine, recommended but only works for Ruby 2.6+ and Rails 5+
dartsass-rails: Dart Sass engine, recommended for Rails projects that use Propshaft
cssbundling-rails: External Sass engine
sassc-rails: SassC engine, deprecated but compatible with Ruby 2.3+ and Rails 4
Also ensure that sprockets-rails is at least v2.3.2.
For wider browser compatibility, use Autoprefixer.
If you are using Rails, add the autoprefixer-rails gem to your app and ensure you have a JavaScript runtime (e.g. NodeJS).
bundle install and restart your server to make the files available through the pipeline.
Import Bootstrap styles in app/assets/stylesheets/application.scss:
// Custom bootstrap variables must be set or imported *before* bootstrap.
@import "bootstrap";
The available variables can be found here.
Make sure the file has .scss extension (or .sass for Sass syntax). If you have just generated a new Rails app,
it may come with a .css file instead. If this file exists, it will be served instead of Sass, so rename it:
While bootstrap-sprockets provides individual Bootstrap components
for ease of debugging, you may alternatively require
the concatenated bootstrap for faster compilation:
If your framework uses Sprockets or Hanami,
the assets will be registered with Sprockets when the gem is required,
and you can use them as per the Rails section of the guide.
Otherwise you may need to register the assets manually.
Refer to your framework's documentation on the subject.
Configuration
Sass: Individual components
By default all of Bootstrap is imported.
You can also import components explicitly. To start with a full list of modules copy
_bootstrap.scss file into your assets as _bootstrap-custom.scss.
Then comment out components you do not want from _bootstrap-custom.
In the application Sass file, replace @import 'bootstrap' with:
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/twbs/bootstrap-rubygem là nguồn chính thức.
twbs/bootstrap-rubygem có phải mã nguồn mở không?
Có — twbs/bootstrap-rubygem phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/twbs/bootstrap-rubygem.
twbs/bootstrap-rubygem có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho twbs/bootstrap-rubygem. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
twbs/bootstrap-rubygem có trang demo không?
Dự án có trang chủ ở https://rubygems.org/gems/bootstrap. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
twbs/bootstrap-rubygem còn đang phát triển không?
Commit gần nhất trên twbs/bootstrap-rubygem là 2 tháng trước (theo timestamp GitHub). Repo có 436 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
twbs/bootstrap-rubygem dùng license gì?
twbs/bootstrap-rubygem phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về bootstrap-rubygem?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về bootstrap-rubygem.