diff --git a/app/assets/stylesheets/_reset.scss b/app/assets/stylesheets/_reset.scss deleted file mode 100644 index 4d1b62f..0000000 --- a/app/assets/stylesheets/_reset.scss +++ /dev/null @@ -1,13 +0,0 @@ -html, body, h1, h2, h3, h4, h5, h6, p, pre, a, dl, dt, dd, ol, ul, li { - font-size: 100%; - vertical-align: baseline; - background: transparent; - box-sizing: border-box; - overflow: visible; - margin: 0; - padding: 0; -} - -body { - line-height: 1; -} diff --git a/app/assets/stylesheets/fonts.scss b/app/assets/stylesheets/fonts.scss deleted file mode 100644 index 2d1842f..0000000 --- a/app/assets/stylesheets/fonts.scss +++ /dev/null @@ -1,23 +0,0 @@ -@import "variables"; - -@font-face { - font-family: 'Raleway'; - src: url('/fonts/raleway-light.woff') format('woff2'); - font-weight: 300; - font-style: normal; -} - -body { - font-family: "Open Sans", Helvetica, Arial, sans-serif; - font-weight: 400; - color: $text-color-body; -} - -h1, h2, h3 { - font-family: Raleway, inherit; - font-weight: 300; -} - -h1 { - text-transform: uppercase; -} diff --git a/app/assets/stylesheets/forms.scss b/app/assets/stylesheets/forms.scss deleted file mode 100644 index b994c05..0000000 --- a/app/assets/stylesheets/forms.scss +++ /dev/null @@ -1,31 +0,0 @@ -form { - .field_with_errors { - display: inline-block; - } -} - -.layout-signup { - label { - display: none; - } - - input[type=text], input[type=email], input[type=password] { - font-size: 1.25rem; - padding: 0.5rem 1rem; - } - - span.at-sign, span.domain { - font-size: 1.25rem; - } - - .error-msg { - color: #bc0101; - } - - .accept-terms { - margin-top: 2rem; - font-size: 0.85rem; - line-height: 1.5em; - color: #888; - } -} diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 743225e..c0e6fba 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -27,7 +27,10 @@ span.icon { svg { + display: inline-block; height: 1.8rem; + margin-top: -0.1rem; + vertical-align: top; width: auto; } @@ -36,19 +39,11 @@ } p.current-user { - margin-top: 2rem; color: rgba(255,255,255,0.6); @include media-max(small) { font-size: 0.85rem; } - - strong { - font-weight: 400; - color: #fff; - // color: #ffd000; - // color: #ccff40; - } } a { @@ -127,9 +122,6 @@ main { width: 100%; th, td { - line-height: 1.5rem; - padding-right: 1rem; - &.hide-small { @include media-max(small) { display: none; @@ -142,13 +134,14 @@ main { font-weight: normal; text-transform: uppercase; font-size: 0.85rem; + padding-bottom: 0.825rem; + } + + td { + padding-top: 0.5rem; padding-bottom: 0.5rem; } } - - .actions { - margin-top: 2rem; - } } .grid { @@ -162,22 +155,5 @@ main { @include media-max(small) { grid-template-columns: 1fr; } - - margin-top: 3rem; - - h3 { - margin-bottom: 1rem; - } - - .grid-item { - p { - color: $text-color-discreet; - font-size: 0.85rem; - } - } } } - -.text-centered { - text-align: center; -} diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 28d7420..bb8d40b 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -7,7 +7,7 @@ require("@rails/ujs").start() require("turbolinks").start() require("channels") - +import "stylesheets/application" // Uncomment to copy all static images under ../images to the output folder and reference // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) // or the `imagePath` JavaScript helper below. diff --git a/app/javascript/stylesheets/application.scss b/app/javascript/stylesheets/application.scss new file mode 100644 index 0000000..5a4d444 --- /dev/null +++ b/app/javascript/stylesheets/application.scss @@ -0,0 +1,8 @@ +@import "tailwindcss/base"; +@import "tailwindcss/components"; +@import "tailwindcss/utilities"; + +@import "base"; +@import "buttons"; +@import "forms"; +@import "links"; diff --git a/app/javascript/stylesheets/base.scss b/app/javascript/stylesheets/base.scss new file mode 100644 index 0000000..1ca5f51 --- /dev/null +++ b/app/javascript/stylesheets/base.scss @@ -0,0 +1,20 @@ +@layer base { + @font-face { + font-family: 'Raleway'; + src: url('/fonts/raleway-light.woff') format('woff2'); + font-weight: 300; + font-style: normal; + } + + body { + line-height: 1; + } + + h1, h2, h3 { + @apply font-heading font-light; + } + + h1 { + @apply uppercase; + } +} diff --git a/app/javascript/stylesheets/buttons.scss b/app/javascript/stylesheets/buttons.scss new file mode 100644 index 0000000..bb76577 --- /dev/null +++ b/app/javascript/stylesheets/buttons.scss @@ -0,0 +1,31 @@ +@layer components { + .btn { + @apply font-semibold rounded-md leading-none cursor-pointer + transition-colors duration-75 focus:outline-none focus:ring-4; + } + + .btn-md { + @apply btn; + @apply py-2.5 px-5 shadow-md; + } + + .btn-sm { + @apply btn; + @apply py-1 px-2 text-sm shadow-sm; + } + + .btn-gray { + @apply bg-gray-100 hover:bg-gray-200 + focus:ring-gray-300 focus:ring-opacity-75; + } + + .btn-blue { + @apply bg-blue-500 hover:bg-blue-600 text-white + focus:ring-blue-400 focus:ring-opacity-75; + } + + .btn-red { + @apply bg-red-600 hover:bg-red-700 text-white + focus:ring-red-500 focus:ring-opacity-75; + } +} diff --git a/app/javascript/stylesheets/forms.scss b/app/javascript/stylesheets/forms.scss new file mode 100644 index 0000000..52013a4 --- /dev/null +++ b/app/javascript/stylesheets/forms.scss @@ -0,0 +1,17 @@ +@layer components { + form { + input[type=text], input[type=email], input[type=password], + input[type=number], select { + @apply mt-1 rounded-md bg-gray-100 focus:bg-white + border-transparent focus:border-gray-500 focus:ring-0; + } + + .field_with_errors { + @apply inline-block; + } + + .error-msg { + @apply text-red-700; + } + } +} diff --git a/app/javascript/stylesheets/links.scss b/app/javascript/stylesheets/links.scss new file mode 100644 index 0000000..c46f68b --- /dev/null +++ b/app/javascript/stylesheets/links.scss @@ -0,0 +1,14 @@ +@layer components { + .ks-text-link { + @apply text-blue-600; + &:hover { @apply underline; } + &:visited { @apply text-indigo-600; } + &:active { @apply text-red-600; } + } + + .devise-links { + a { + @apply ks-text-link; + } + } +} diff --git a/app/javascript/stylesheets/tailwind.config.js b/app/javascript/stylesheets/tailwind.config.js new file mode 100644 index 0000000..9235247 --- /dev/null +++ b/app/javascript/stylesheets/tailwind.config.js @@ -0,0 +1,23 @@ +const defaultTheme = require('tailwindcss/defaultTheme') + +module.exports = { + purge: [ + "./app/**/*.html.erb", + "./app/helpers/**/*.rb", + "./app/javascript/**/*.js" + ], + darkMode: false, // or 'media' or 'class' + theme: { + extend: { + fontFamily: { + heading: ['Raleway'] + } + }, + }, + variants: { + extend: {}, + }, + plugins: [ + require('@tailwindcss/forms') + ], +} diff --git a/app/views/admin/dashboard/index.html.erb b/app/views/admin/dashboard/index.html.erb index 2e04a10..e7f405a 100644 --- a/app/views/admin/dashboard/index.html.erb +++ b/app/views/admin/dashboard/index.html.erb @@ -1,3 +1,3 @@ -
+
With great power comes great responsibility.
diff --git a/app/views/admin/donations/_form.html.erb b/app/views/admin/donations/_form.html.erb index 038d129..1405b08 100644 --- a/app/views/admin/donations/_form.html.erb +++ b/app/views/admin/donations/_form.html.erb @@ -52,9 +52,7 @@ -- <%= form.submit %> -
-+ <%= form.submit class: 'btn-md btn-blue' %> +
<% end %> diff --git a/app/views/admin/donations/edit.html.erb b/app/views/admin/donations/edit.html.erb index f3bffd3..5042797 100644 --- a/app/views/admin/donations/edit.html.erb +++ b/app/views/admin/donations/edit.html.erb @@ -2,7 +2,7 @@ <%= render 'form', donation: @donation, url: admin_donation_path(@donation) %> -- <%= link_to 'Show', admin_donation_path(@donation) %> | - <%= link_to 'Back', admin_donations_path %> +
+ <%= link_to 'Show', admin_donation_path(@donation), class: 'ks-text-link' %> | + <%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %>
diff --git a/app/views/admin/donations/index.html.erb b/app/views/admin/donations/index.html.erb index e0d38ce..3325d1c 100644 --- a/app/views/admin/donations/index.html.erb +++ b/app/views/admin/donations/index.html.erb @@ -23,9 +23,9 @@
- <%= link_to 'Record an out-of-system donation', new_admin_donation_path %> +
+ <%= link_to 'Record an out-of-system donation', new_admin_donation_path, class: 'btn-md btn-gray' %>
diff --git a/app/views/admin/donations/new.html.erb b/app/views/admin/donations/new.html.erb index 4fd44bf..ca10ca3 100644 --- a/app/views/admin/donations/new.html.erb +++ b/app/views/admin/donations/new.html.erb @@ -2,6 +2,6 @@ <%= render 'form', donation: @donation, url: admin_donations_path %> -- <%= link_to 'Back', admin_donations_path %> +
+ <%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %>
diff --git a/app/views/admin/donations/show.html.erb b/app/views/admin/donations/show.html.erb index 12bc37e..dd929f2 100644 --- a/app/views/admin/donations/show.html.erb +++ b/app/views/admin/donations/show.html.erb @@ -30,5 +30,7 @@ <%= @donation.paid_at %> -<%= link_to 'Edit', edit_admin_donation_path(@donation) %> | -<%= link_to 'Back', admin_donations_path %> ++ <%= link_to 'Edit', edit_admin_donation_path(@donation), class: 'ks-text-link' %> | + <%= link_to 'Back', admin_donations_path, class: 'ks-text-link' %> +
diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb index d0261fa..bfd21f7 100644 --- a/app/views/dashboard/index.html.erb +++ b/app/views/dashboard/index.html.erb @@ -4,35 +4,45 @@ Your Kosmos account and password currently give you access to these services: -+
Chat rooms and instant messaging (XMPP/Jabber)
+
Kosmos documentation and knowledge base
+
Kosmos community forums and user support/help site
+
Code hosting and collaboration for software projects
- Continuous integration for software projects, tied to our Gitea +
+ Continuous integration for software projects on Gitea
- <%= f.label :email, 'Email address' %>
- <%= f.email_field :email, required: true, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
-
- <%= f.submit "Resend confirmation instructions" %> -
-+ <%= f.label :email, 'Email address', class: 'block mb-1' %> + <%= f.email_field :email, required: true, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %> +
++ <%= f.submit "Resend confirmation instructions", class: 'btn-md btn-blue' %> +
<% end %> <%= render "devise/shared/links" %> diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb index 5fbb9ff..7419237 100644 --- a/app/views/devise/passwords/edit.html.erb +++ b/app/views/devise/passwords/edit.html.erb @@ -4,22 +4,24 @@ <%= render "devise/shared/error_messages", resource: resource %> <%= f.hidden_field :reset_password_token %> -+ <%= f.label :password, "New password" %> +
+<%= f.password_field :password, autofocus: true, autocomplete: "new-password" %> -
+ <%= f.label :password_confirmation, "Confirm new password" %> +
+<%= f.password_field :password_confirmation, autocomplete: "new-password" %> -
+ <%= f.submit "Change my password", class: 'btn-md btn-blue' %> +
<% end %> <%= render "devise/shared/links" %> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index ed6d7ce..65006f9 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -2,26 +2,17 @@ <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> <%= render "devise/shared/error_messages", resource: resource %> - -
- <%= f.label :cn, 'User' %>
- <%= f.text_field :cn, autofocus: true, autocomplete: "username", required: true %> @ kosmos.org
-
- <%= f.label :email, 'Email address' %>
- <%= f.email_field :email, autocomplete: "email", required: true %>
-
- <%= f.submit "Send me reset password instructions" %> -
-+ <%= f.label :cn, 'User', class: 'block' %> + <%= f.text_field :cn, autofocus: true, autocomplete: "username", required: true %> @ kosmos.org +
++ <%= f.label :email, 'Email address', class: 'block' %> + <%= f.email_field :email, autocomplete: "email", required: true %> +
++ <%= f.submit "Send me reset password instructions", class: 'btn-md btn-blue' %> +
<% end %> <%= render "devise/shared/links" %> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 38d95b8..4df4cab 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -31,9 +31,9 @@ <%= f.password_field :current_password, autocomplete: "current-password" %>+ <%= f.submit "Update", class: 'btn-md btn-blue' %> +
<% end %>
- <%= f.label :cn, 'User' %>
- <%= f.text_field :cn, autofocus: true, autocomplete: "username" %> @ kosmos.org
-
- <%= f.label :password %>
- <%= f.password_field :password, autocomplete: "current-password" %>
-
- <%= f.submit "Log in" %> -
-+ <%= f.label :cn, 'User', class: 'block' %> + <%= f.text_field :cn, autofocus: true, autocomplete: "username" %> @ kosmos.org +
++ <%= f.label :password, class: 'block' %> + <%= f.password_field :password, autocomplete: "current-password" %> +
++ <%= f.submit "Log in", class: 'btn-md btn-blue' %> +
<% end %> <%= render "devise/shared/links" %> diff --git a/app/views/devise/shared/_links.html.erb b/app/views/devise/shared/_links.html.erb index fef9bef..b1d1ccd 100644 --- a/app/views/devise/shared/_links.html.erb +++ b/app/views/devise/shared/_links.html.erb @@ -1,24 +1,24 @@ -+
<%= link_to "Log in", new_session_path(resource_name) %>
+
<%= link_to "Forgot your password?", new_password_path(resource_name) %>
+
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
+
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
<%= f.label :email %>
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
-
+ <%= f.submit "Resend unlock instructions", class: 'btn-md btn-blue' %> +
<% end %> <%= render "devise/shared/links" %> diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 8a6368a..378a47e 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -8,6 +8,7 @@ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> + <%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> @@ -19,12 +20,7 @@ Kosmos Accounts - <% if user_signed_in? %> -- Signed in as <%= current_user.cn %>@kosmos.org. - <%= link_to "Log out", destroy_user_session_path, method: :delete %> -
- <% end %> + <%= render partial: 'shared/header_account' %> <% if user_signed_in? && current_user.confirmed? %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index bdf836e..9be387d 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -8,6 +8,7 @@ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> + <%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> @@ -19,12 +20,7 @@ Kosmos Account - <% if user_signed_in? %> -- Signed in as <%= current_user.cn %>@kosmos.org. - <%= link_to "Log out", destroy_user_session_path, method: :delete %> -
- <% end %> + <%= render partial: 'shared/header_account' %> <% if user_signed_in? && current_user.confirmed? %> diff --git a/app/views/layouts/signup.html.erb b/app/views/layouts/signup.html.erb index b2ddc1c..0f7a658 100644 --- a/app/views/layouts/signup.html.erb +++ b/app/views/layouts/signup.html.erb @@ -8,6 +8,7 @@ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> + <%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> diff --git a/app/views/security/index.html.erb b/app/views/security/index.html.erb index dbe2e0a..e1169b6 100644 --- a/app/views/security/index.html.erb +++ b/app/views/security/index.html.erb @@ -6,7 +6,7 @@<%= form_with(url: settings_reset_password_path, method: :post) do %> - <%= submit_tag("Send me a password reset link") %> + <%= submit_tag("Send me a password reset link", class: 'btn-md btn-gray') %> <% end %>
diff --git a/app/views/shared/_header_account.html.erb b/app/views/shared/_header_account.html.erb new file mode 100644 index 0000000..615f6fb --- /dev/null +++ b/app/views/shared/_header_account.html.erb @@ -0,0 +1,6 @@ +<% if user_signed_in? %> ++ Signed in as <%= current_user.cn %>@kosmos.org. + <%= link_to "Log out", destroy_user_session_path, method: :delete, class: 'underline' %> +
+<% end %> diff --git a/app/views/signup/index.html.erb b/app/views/signup/index.html.erb index f3d8b80..25ed61e 100644 --- a/app/views/signup/index.html.erb +++ b/app/views/signup/index.html.erb @@ -7,6 +7,6 @@ This invitation can only be used once, and sign-up is currently only possible by invitation. Seems like you have good friends! -- <%= link_to "Get started", signup_steps_path(1), class: "next-step" %> +
+ <%= link_to "Get started", signup_steps_path(1), class: "btn btn-md btn-blue" %>
diff --git a/app/views/signup/steps.html.erb b/app/views/signup/steps.html.erb index 3c527f4..53cf237 100644 --- a/app/views/signup/steps.html.erb +++ b/app/views/signup/steps.html.erb @@ -2,60 +2,53 @@ <% when 1 %>
- <%= f.label :cn, 'Username' %>
- <%= f.text_field :cn, autofocus: true, autocomplete: "username" %>
- @
- kosmos.org
-
Username <%= @validation_error %>
- <% end %> -<%= f.submit "Continue" %>
-+ <%= f.label :cn, 'Username', class: 'hidden' %> + <%= f.text_field :cn, autofocus: true, autocomplete: "username", + class: 'text-xl' %> + @ + kosmos.org +
+ <% if @validation_error.present? %> +Username <%= @validation_error %>
+ <% end %> ++ <%= f.submit "Continue", class: 'btn btn-md btn-blue' %> +
<% end %> <% when 2 %>
- <%= f.label :email, 'Email address' %>
- <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
-
Email <%= @validation_error %>
- <% end %> -<%= f.submit "Continue" %>
-+ <%= f.label :email, 'Email address', class: 'hidden' %> + <%= f.email_field :email, autofocus: true, autocomplete: 'email', class: 'text-xl' %> +
+ <% if @validation_error.present? %> +Email <%= @validation_error %>
+ <% end %> ++ <%= f.submit "Continue", class: 'btn btn-md btn-blue' %> +
<% end %> <% when 3 %>
- <%= f.label :password, 'Password' %>
- <%= f.password_field :password, autofocus: true %>
-
Password <%= @validation_error %>
- <% end %> -- - By clicking the button below, you accept our future Terms of Service - and Privacy Policy. Don't worry, they will be excellent! - +
+ <%= f.label :password, 'Password', class: 'hidden' %> + <%= f.password_field :password, autofocus: true, class: 'text-xl' %> +
+ <% if @validation_error.present? %> +Password <%= @validation_error %>
+ <% end %> ++ By clicking the button below, you accept our future Terms of Service + and Privacy Policy. Don't worry, they will be excellent! +
++ <%= f.submit "Create account", class: 'btn-md btn-blue' %>
-<%= f.submit "Create account" %>
-