Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile CSS into Gem #211

Merged
merged 4 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ Gemfile.lock
/coverage/
/rdoc/
.ruby-*
/node_modules/
1 change: 1 addition & 0 deletions app/assets/builds/alchemy-devise.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/assets/builds/alchemy-devise.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions app/assets/stylesheets/alchemy-devise.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
@import "alchemy/defaults";
@import "alchemy-devise/*";
@import "alchemy-devise/login";
10 changes: 5 additions & 5 deletions app/assets/stylesheets/alchemy-devise/login.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
body.user_sessions,
body.passwords {
background-color: $main-menu-bg-color;
color: $white;
background-color: var(--color-blue_dark);
color: var(--color-white);

a {
color: $white;
color: var(--color-white);
}

#errors,
Expand Down Expand Up @@ -43,7 +43,7 @@ body.passwords {
}

button.secondary {
color: $white;
border-color: $white;
color: var(--color-white);
border-color: var(--color-white);
}
}
7 changes: 0 additions & 7 deletions app/assets/stylesheets/alchemy-devise/users.scss

This file was deleted.

3 changes: 0 additions & 3 deletions app/assets/stylesheets/alchemy/admin/alchemy-devise.css

This file was deleted.

4 changes: 4 additions & 0 deletions app/views/alchemy/admin/passwords/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<%= content_for :stylesheets do %>
<%= stylesheet_link_tag "alchemy-devise" %>
<% end %>

<div class="login_signup_box">
<%= image_tag 'alchemy/alchemy-logo.svg', id: 'logo' %>
<% if @user.errors.blank? %>
Expand Down
4 changes: 4 additions & 0 deletions app/views/alchemy/admin/passwords/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<%= content_for :stylesheets do %>
<%= stylesheet_link_tag "alchemy-devise" %>
<% end %>

<div class="login_signup_box">
<%= image_tag 'alchemy/alchemy-logo.svg', id: 'logo' %>
<% if @user.errors.blank? %>
Expand Down
12 changes: 4 additions & 8 deletions app/views/alchemy/admin/user_sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<%= content_for :stylesheets do %>
<%= stylesheet_link_tag "alchemy-devise" %>
<% end %>

<div class="login_signup_box">
<%= image_tag 'alchemy/alchemy-logo.svg', id: 'logo' %>
<%= alchemy_form_for :user, url: {action: 'create'}, id: 'login', data: { turbo: false } do |f| %>
Expand All @@ -13,11 +17,3 @@
</div>
<% end %>
</div>

<%- content_for :javascripts do -%>
<script type="text/javascript" charset="utf-8">
jQuery(function($) {
$('#user_login').focus();
});
</script>
<%- end -%>
4 changes: 4 additions & 0 deletions app/views/alchemy/admin/users/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<%= content_for :stylesheets do %>
<%= stylesheet_link_tag "alchemy-devise" %>
<% end %>

<%= content_for :toolbar do %>
<%= toolbar_button(
icon: :plus,
Expand Down
4 changes: 4 additions & 0 deletions app/views/alchemy/admin/users/signup.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<%= content_for :stylesheets do %>
<%= stylesheet_link_tag "alchemy-devise" %>
<% end %>

<div class="login_signup_box">
<%= image_tag 'alchemy/alchemy-logo.svg', id: 'logo' %>
<%= render_message do %>
Expand Down
6 changes: 0 additions & 6 deletions lib/generators/alchemy/devise/install/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ def add_migrations
def run_migrations
run "bundle exec rake db:migrate"
end

def append_assets
insert_into_file "vendor/assets/stylesheets/alchemy/admin/all.css",
"\n *= require alchemy/admin/alchemy-devise",
after: " *= require alchemy/admin"
end
end
end
end
Expand Down
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "alchemy-devise",
"author": "Thomas von Deyen",
"license": "BSD-3-Clause",
"scripts": {
"build": "sass --style=compressed --source-map --load-path app/assets/stylesheets app/assets/stylesheets/alchemy-devise.scss:app/assets/builds/alchemy-devise.css"
},
"devDependencies": {
"sass": "^1.77.8"
}
}
124 changes: 124 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


anymatch@~3.1.2:
version "3.1.3"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e"
integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==
dependencies:
normalize-path "^3.0.0"
picomatch "^2.0.4"

binary-extensions@^2.0.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522"
integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==

braces@~3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
dependencies:
fill-range "^7.1.1"

"chokidar@>=3.0.0 <4.0.0":
version "3.6.0"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b"
integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==
dependencies:
anymatch "~3.1.2"
braces "~3.0.2"
glob-parent "~5.1.2"
is-binary-path "~2.1.0"
is-glob "~4.0.1"
normalize-path "~3.0.0"
readdirp "~3.6.0"
optionalDependencies:
fsevents "~2.3.2"

fill-range@^7.1.1:
version "7.1.1"
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292"
integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==
dependencies:
to-regex-range "^5.0.1"

fsevents@~2.3.2:
version "2.3.3"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==

glob-parent@~5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
dependencies:
is-glob "^4.0.1"

immutable@^4.0.0:
version "4.3.6"
resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.6.tgz#6a05f7858213238e587fb83586ffa3b4b27f0447"
integrity sha512-Ju0+lEMyzMVZarkTn/gqRpdqd5dOPaz1mCZ0SH3JV6iFw81PldE/PEB1hWVEA288HPt4WXW8O7AWxB10M+03QQ==

is-binary-path@~2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
dependencies:
binary-extensions "^2.0.0"

is-extglob@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==

is-glob@^4.0.1, is-glob@~4.0.1:
version "4.0.3"
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
dependencies:
is-extglob "^2.1.1"

is-number@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==

normalize-path@^3.0.0, normalize-path@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==

picomatch@^2.0.4, picomatch@^2.2.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==

readdirp@~3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==
dependencies:
picomatch "^2.2.1"

sass@^1.77.8:
version "1.77.8"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.77.8.tgz#9f18b449ea401759ef7ec1752a16373e296b52bd"
integrity sha512-4UHg6prsrycW20fqLGPShtEvo/WyHRVRHwOP4DzkUrObWoWI05QBSfzU71TVB7PFaL104TwNaHpjlWXAZbQiNQ==
dependencies:
chokidar ">=3.0.0 <4.0.0"
immutable "^4.0.0"
source-map-js ">=0.6.2 <2.0.0"

"source-map-js@>=0.6.2 <2.0.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af"
integrity sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==

to-regex-range@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
dependencies:
is-number "^7.0.0"
Loading