From eec467a16c5ed186a7b4b05410312f8f2ba1e28c Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Tue, 16 Jul 2024 10:19:03 +0200 Subject: [PATCH 1/4] Remove autofocus JS from login form We use the autofocus property on the input. All modern browsers support that. --- app/views/alchemy/admin/user_sessions/new.html.erb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/views/alchemy/admin/user_sessions/new.html.erb b/app/views/alchemy/admin/user_sessions/new.html.erb index ccee697..9b6eff2 100644 --- a/app/views/alchemy/admin/user_sessions/new.html.erb +++ b/app/views/alchemy/admin/user_sessions/new.html.erb @@ -13,11 +13,3 @@ <% end %> - -<%- content_for :javascripts do -%> - -<%- end -%> From d772a37d9c5b2e55074245e857dd046a3da378dd Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Tue, 16 Jul 2024 10:58:01 +0200 Subject: [PATCH 2/4] Remove unused style The user roles are no check boxes --- app/assets/stylesheets/alchemy-devise/users.scss | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 app/assets/stylesheets/alchemy-devise/users.scss diff --git a/app/assets/stylesheets/alchemy-devise/users.scss b/app/assets/stylesheets/alchemy-devise/users.scss deleted file mode 100644 index 0be170f..0000000 --- a/app/assets/stylesheets/alchemy-devise/users.scss +++ /dev/null @@ -1,7 +0,0 @@ -form { - - &.user_roles .checkbox { - display: inline-block; - width: 50%; - } -} From d2ba8e28ad8ce2a38227720d702e9d5c031bb045 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Tue, 16 Jul 2024 10:59:36 +0200 Subject: [PATCH 3/4] Use Alchemy's custom properties for colors We do not need Sass variables for that. --- app/assets/stylesheets/alchemy-devise.scss | 1 - app/assets/stylesheets/alchemy-devise/login.scss | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/alchemy-devise.scss b/app/assets/stylesheets/alchemy-devise.scss index 2407506..de9acdf 100644 --- a/app/assets/stylesheets/alchemy-devise.scss +++ b/app/assets/stylesheets/alchemy-devise.scss @@ -1,2 +1 @@ -@import "alchemy/defaults"; @import "alchemy-devise/*"; diff --git a/app/assets/stylesheets/alchemy-devise/login.scss b/app/assets/stylesheets/alchemy-devise/login.scss index 6967cb6..75d777a 100644 --- a/app/assets/stylesheets/alchemy-devise/login.scss +++ b/app/assets/stylesheets/alchemy-devise/login.scss @@ -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, @@ -43,7 +43,7 @@ body.passwords { } button.secondary { - color: $white; - border-color: $white; + color: var(--color-white); + border-color: var(--color-white); } } From dc9ee895901a9ab12adf47059a95259cafb7a827 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Tue, 16 Jul 2024 11:02:54 +0200 Subject: [PATCH 4/4] Use Dart Sass to compile stylesheets Instead of using sprockets and it's Sassc adapter we use Dart Sass to procompile assets and ship them in this gem. --- .gitignore | 1 + app/assets/builds/alchemy-devise.css | 1 + app/assets/builds/alchemy-devise.css.map | 1 + app/assets/stylesheets/alchemy-devise.scss | 2 +- .../alchemy/admin/alchemy-devise.css | 3 - .../alchemy/admin/passwords/edit.html.erb | 4 + .../alchemy/admin/passwords/new.html.erb | 4 + .../alchemy/admin/user_sessions/new.html.erb | 4 + app/views/alchemy/admin/users/index.html.erb | 4 + app/views/alchemy/admin/users/signup.html.erb | 4 + .../devise/install/install_generator.rb | 6 - package.json | 11 ++ yarn.lock | 124 ++++++++++++++++++ 13 files changed, 159 insertions(+), 10 deletions(-) create mode 100644 app/assets/builds/alchemy-devise.css create mode 100644 app/assets/builds/alchemy-devise.css.map delete mode 100644 app/assets/stylesheets/alchemy/admin/alchemy-devise.css create mode 100644 package.json create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore index 6bd5aa3..7ac4dec 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ Gemfile.lock /coverage/ /rdoc/ .ruby-* +/node_modules/ diff --git a/app/assets/builds/alchemy-devise.css b/app/assets/builds/alchemy-devise.css new file mode 100644 index 0000000..ec8c20e --- /dev/null +++ b/app/assets/builds/alchemy-devise.css @@ -0,0 +1 @@ +body.user_sessions,body.passwords{background-color:var(--color-blue_dark);color:var(--color-white)}body.user_sessions a,body.passwords a{color:var(--color-white)}body.user_sessions #errors,body.user_sessions .message.info,body.passwords #errors,body.passwords .message.info{border-color:rgba(0,0,0,0)}body.user_sessions #errors,body.passwords #errors{margin-left:157px}#logo{width:275px;height:auto;margin:0 0 1em 164px}.login_signup_box{position:absolute;width:450px;top:50%;left:50%;transform:translate(-60%, -50%)}.no-js .login_signup_box{display:none}.login_signup_box .message{margin-left:157px}.login_signup_box .link{text-align:right}.login_signup_box button.secondary{color:var(--color-white);border-color:var(--color-white)}form.user_roles .checkbox{display:inline-block;width:50%}/*# sourceMappingURL=alchemy-devise.css.map */ diff --git a/app/assets/builds/alchemy-devise.css.map b/app/assets/builds/alchemy-devise.css.map new file mode 100644 index 0000000..ac261f1 --- /dev/null +++ b/app/assets/builds/alchemy-devise.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["../stylesheets/alchemy-devise/login.scss","../stylesheets/alchemy-devise/users.scss"],"names":[],"mappings":"AAAA,kCAEE,wCACA,yBAEA,sCACE,yBAGF,gHAEE,2BAGF,kDACE,kBAIJ,MACE,YACA,YACA,qBAGF,kBACE,kBACA,YACA,QACA,SACA,gCAEA,yBACE,aAGF,2BACE,kBAGF,wBACE,iBAGF,mCACE,yBACA,gCC5CF,0BACE,qBACA","file":"alchemy-devise.css"} \ No newline at end of file diff --git a/app/assets/stylesheets/alchemy-devise.scss b/app/assets/stylesheets/alchemy-devise.scss index de9acdf..774f34a 100644 --- a/app/assets/stylesheets/alchemy-devise.scss +++ b/app/assets/stylesheets/alchemy-devise.scss @@ -1 +1 @@ -@import "alchemy-devise/*"; +@import "alchemy-devise/login"; diff --git a/app/assets/stylesheets/alchemy/admin/alchemy-devise.css b/app/assets/stylesheets/alchemy/admin/alchemy-devise.css deleted file mode 100644 index 509830f..0000000 --- a/app/assets/stylesheets/alchemy/admin/alchemy-devise.css +++ /dev/null @@ -1,3 +0,0 @@ -/* - *= require alchemy-devise - */ diff --git a/app/views/alchemy/admin/passwords/edit.html.erb b/app/views/alchemy/admin/passwords/edit.html.erb index db35d1e..cc0e80f 100644 --- a/app/views/alchemy/admin/passwords/edit.html.erb +++ b/app/views/alchemy/admin/passwords/edit.html.erb @@ -1,3 +1,7 @@ +<%= content_for :stylesheets do %> + <%= stylesheet_link_tag "alchemy-devise" %> +<% end %> +