cssbundling-rails 0.1.8 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a70423b8588a0b537518131ad10a0a702e5891343a3800ac099c13de2a2b8e1f
4
- data.tar.gz: 237ee6613b56c3296a1ad95b78cdb6bac8cd78a900879f006ce06c1ec314fca8
3
+ metadata.gz: b6117a89a0593ef2dee1518e29ab5792245610a4acd449b2f43dab754c421a56
4
+ data.tar.gz: ae5a61e547d29d5fc9a44bf6a28ecbc24fde91194cdc1262417ec6d3b17810f0
5
5
  SHA512:
6
- metadata.gz: 005d6451373ec31e23cdca38b8f75bd32426bcabb94bc7c7d88675e682a24c75a104b8fcab0725806503f22cf04c388fe25bdb2ffd67ff92871856f711576ef3
7
- data.tar.gz: '08966254d0702d793a7f09322b8a01820c42a5cc76d23ee4d6cc991a849a23be5a548329f7c804afcbeff422b672689cff1b49a4de66a57bc3f25f2f32b74d85'
6
+ metadata.gz: cd33d2acdc38b13ee350cc703b97e9eae5bd4a4eef67edda05acde3f237b73b3a93c9012edb759b86aed22888832ad72bd17a111abf81fe97ca5f218c7e6f6e0
7
+ data.tar.gz: 8649ee814fac443401fea17891629d3f1f4f1fc5fb135f27eb3a662550b4bbbb29906344fe01d08a4ffd0f3305802a79effdd4542f2b76b6155f349a8ef5b124
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CSS Bundling for Rails
2
2
 
3
- Use [Tailwind CSS](https://tailwindcss.com), [Bootstrap](https://getbootstrap.com/), [PostCSS](https://postcss.org), or [Dart Sass](https://sass-lang.com/) to bundle and process your CSS, then deliver it via the asset pipeline in Rails. This gem provides installers to get you going with the bundler of your choice in a new Rails application, and a convention to use `app/assets/builds` to hold your bundled output as artifacts that are not checked into source control (the installer adds this directory to `.gitignore` by default).
3
+ Use [Tailwind CSS](https://tailwindcss.com), [Bootstrap](https://getbootstrap.com/), [Bulma](https://bulma.io/), [PostCSS](https://postcss.org), or [Dart Sass](https://sass-lang.com/) to bundle and process your CSS, then deliver it via the asset pipeline in Rails. This gem provides installers to get you going with the bundler of your choice in a new Rails application, and a convention to use `app/assets/builds` to hold your bundled output as artifacts that are not checked into source control (the installer adds this directory to `.gitignore` by default).
4
4
 
5
5
  You develop using this approach by running the bundler in watch mode in a terminal with `yarn build:css --watch` (and your Rails server in another, if you're not using something like [puma-dev](https://github.com/puma/puma-dev)). Whenever the bundler detects changes to any of the stylesheet files in your project, it'll bundle `app/assets/stylesheets/application.[bundler].css` into `app/assets/builds/application.css`. This build output takes over from the regular asset pipeline default file. So you continue to refer to the build output in your layout using the standard asset pipeline approach with `<%= stylesheet_link_tag "application" %>`.
6
6
 
@@ -21,9 +21,9 @@ You must already have node and yarn installed on your system. You will also need
21
21
 
22
22
  1. Add `cssbundling-rails` to your Gemfile with `gem 'cssbundling-rails'`
23
23
  2. Run `./bin/bundle install`
24
- 3. Run `./bin/rails css:install:[tailwind|bootstrap|postcss|sass]`
24
+ 3. Run `./bin/rails css:install:[tailwind|bootstrap|bulma|postcss|sass]`
25
25
 
26
- Or, in Rails 7+, you can preconfigure your new application to use a specific bundler with `rails new myapp --css [tailwind|bootstrap|postcss|sass]`.
26
+ Or, in Rails 7+, you can preconfigure your new application to use a specific bundler with `rails new myapp --css [tailwind|bootstrap|bulma|postcss|sass]`.
27
27
 
28
28
 
29
29
  ## License
@@ -1,3 +1,3 @@
1
1
  module Cssbundling
2
- VERSION = "0.1.8"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -0,0 +1,39 @@
1
+ // @charset "utf-8";
2
+
3
+ // Import a Google Font
4
+ // @import url('https://fonts.googleapis.com/css?family=Nunito:400,700');
5
+
6
+ // Set your brand colors
7
+ // $purple: #8A4D76;
8
+ // $pink: #FA7C91;
9
+ // $brown: #757763;
10
+ // $beige-light: #D0D1CD;
11
+ // $beige-lighter: #EFF0EB;
12
+
13
+ // Update Bulma's global variables
14
+ // $family-sans-serif: "Nunito", sans-serif;
15
+ // $grey-dark: $brown;
16
+ // $grey-light: $beige-light;
17
+ // $primary: $purple;
18
+ // $link: $pink;
19
+ // $widescreen-enabled: false;
20
+ // $fullhd-enabled: false;
21
+
22
+ // Update some of Bulma's component variables
23
+ // $body-background-color: $beige-lighter;
24
+ // $control-border-width: 2px;
25
+ // $input-border-color: transparent;
26
+ // $input-shadow: none;
27
+
28
+ // Import only what you need from Bulma
29
+ // @import "bulma/sass/utilities/_all.sass";
30
+ // @import "bulma/sass/base/_all.sass";
31
+ // @import "bulma/sass/elements/button.sass";
32
+ // @import "bulma/sass/elements/container.sass";
33
+ // @import "bulma/sass/elements/title.sass";
34
+ // @import "bulma/sass/form/_all.sass";
35
+ // @import "bulma/sass/components/navbar.sass";
36
+ // @import "bulma/sass/layout/hero.sass";
37
+ // @import "bulma/sass/layout/section.sass";
38
+
39
+ @import 'bulma/bulma';
@@ -0,0 +1,7 @@
1
+ say "Install Bulma"
2
+ copy_file "#{__dir__}/application.bulma.scss",
3
+ "app/assets/stylesheets/application.bulma.scss"
4
+ run "yarn add sass bulma"
5
+
6
+ say "Add build:css script"
7
+ run %(npm set-script build:css "sass ./app/assets/stylesheets/application.bulma.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules")
@@ -1,7 +1,10 @@
1
1
  say "Build into app/assets/builds"
2
2
  empty_directory "app/assets/builds"
3
3
  keep_file "app/assets/builds"
4
- append_to_file "app/assets/config/manifest.js", %(//= link_tree ../builds\n)
4
+
5
+ if (sprockets_manifest_path = Rails.root.join("app/assets/config/manifest.js")).exist?
6
+ append_to_file sprockets_manifest_path, %(//= link_tree ../builds\n)
7
+ end
5
8
 
6
9
  say "Stop linking stylesheets automatically"
7
10
  gsub_file "app/assets/config/manifest.js", "//= link_directory ../stylesheets .css\n", ""
@@ -38,7 +41,7 @@ unless Rails.root.join("package.json").exist?
38
41
  end
39
42
 
40
43
  if Rails.root.join("Procfile.dev").exist?
41
- append_to_file "Procfile.dev", "\ncss: yarn build:css --watch"
44
+ append_to_file "Procfile.dev", "css: yarn build:css --watch\n"
42
45
  else
43
46
  say "Add default Procfile.dev"
44
47
  copy_file "#{__dir__}/Procfile.dev", "Procfile.dev"
@@ -24,5 +24,10 @@ namespace :css do
24
24
  task bootstrap: "css:install:shared" do
25
25
  system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{File.expand_path("../../install/bootstrap/install.rb", __dir__)}"
26
26
  end
27
+
28
+ desc "Install Bulma"
29
+ task bulma: "css:install:shared" do
30
+ system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{File.expand_path("../../install/bulma/install.rb", __dir__)}"
31
+ end
27
32
  end
28
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cssbundling-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-09-17 00:00:00.000000000 Z
12
+ date: 2021-09-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -53,6 +53,8 @@ files:
53
53
  - lib/install/Procfile.dev
54
54
  - lib/install/bootstrap/application.bootstrap.scss
55
55
  - lib/install/bootstrap/install.rb
56
+ - lib/install/bulma/application.bulma.scss
57
+ - lib/install/bulma/install.rb
56
58
  - lib/install/dev
57
59
  - lib/install/install.rb
58
60
  - lib/install/package.json