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 @@ <%= number_to_currency donation.amount_usd / 100, unit: "" %> <%= donation.public_name %> <%= donation.paid_at ? donation.paid_at.strftime("%Y-%m-%d") : "" %> - <%= link_to 'Show', admin_donation_path(donation) %> - <%= link_to 'Edit', edit_admin_donation_path(donation) %> - <%= link_to 'Destroy', admin_donation_path(donation), method: :delete, data: { confirm: 'Are you sure?' } %> + <%= link_to 'Show', admin_donation_path(donation), class: 'btn btn-sm btn-gray' %> + <%= link_to 'Edit', edit_admin_donation_path(donation), class: 'btn btn-sm btn-gray' %> + <%= link_to 'Destroy', admin_donation_path(donation), class: 'btn btn-sm btn-red', method: :delete, data: { confirm: 'Are you sure?' } %> <% end %> @@ -36,6 +36,6 @@

<% end %> -

- <%= 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:

-
-
-

<%= link_to "Chat", "https://wiki.kosmos.org/Services:Chat" %>

-

+

+
+

+ <%= link_to "Chat", "https://wiki.kosmos.org/Services:Chat", class: "ks-text-link" %> +

+

Chat rooms and instant messaging (XMPP/Jabber)

-
-

<%= link_to "Wiki", "https://wiki.kosmos.org" %>

-

+

+

+ <%= link_to "Wiki", "https://wiki.kosmos.org", class: "ks-text-link" %> +

+

Kosmos documentation and knowledge base

-
-

<%= link_to "Discourse", "https://community.kosmos.org" %>

-

+

+

+ <%= link_to "Discourse", "https://community.kosmos.org", class: "ks-text-link" %> +

+

Kosmos community forums and user support/help site

-
-

<%= link_to "Gitea", "https://gitea.kosmos.org" %>

-

+

+

+ <%= link_to "Gitea", "https://gitea.kosmos.org", class: "ks-text-link" %> +

+

Code hosting and collaboration for software projects

-
-

<%= link_to "Drone CI", "https://drone.kosmos.org" %>

-

- Continuous integration for software projects, tied to our Gitea +

+

+ <%= link_to "Drone CI", "https://drone.kosmos.org", class: "ks-text-link" %> +

+

+ Continuous integration for software projects on Gitea

diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index 5a46eee..40c840d 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -2,19 +2,13 @@ <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> <%= render "devise/shared/error_messages", resource: resource %> - -
-

- <%= 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" %>
- <% if @minimum_password_length %> - (<%= @minimum_password_length %> characters minimum)
- <% end %> +

+ <%= f.label :password, "New password" %> +

+

<%= f.password_field :password, autofocus: true, autocomplete: "new-password" %> -

- -
- <%= f.label :password_confirmation, "Confirm new password" %>
+ <% if @minimum_password_length %> +
(<%= @minimum_password_length %> characters minimum) + <% end %> +

+

+ <%= f.label :password_confirmation, "Confirm new password" %> +

+

<%= f.password_field :password_confirmation, autocomplete: "new-password" %> -

- -
- <%= f.submit "Change my 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" %> -
+

+ <%= f.submit "Update", class: 'btn-md btn-blue' %> +

<% end %>

Cancel my account

diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 5466dad..da446c8 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -2,24 +2,17 @@ <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> <%= render "devise/shared/error_messages", resource: resource %> - -
-

- <%= 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 @@ -