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

Accessibility improvements for Halcyonic theme #1088

Merged
merged 10 commits into from
Apr 29, 2021
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
296 changes: 150 additions & 146 deletions Gemfile.lock

Large diffs are not rendered by default.

10 changes: 2 additions & 8 deletions plugins/ShinyCMS/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,6 @@ Style/IpAddresses:
Style/RegexpLiteral:
Enabled: false

# Disabling these for now, as part of the first run at enforcing boundaries with Packwerk
Style/StaticClass:
Exclude:
- app/public/models/shinycms/interface/*.rb
Naming/PredicateName:
Exclude:
- app/public/models/shinycms/interface/*.rb

# Whitespace Considered Helpful
Layout/ExtraSpacing:
Enabled: false
Expand All @@ -216,6 +208,8 @@ Layout/SpaceInsidePercentLiteralDelimiters:
Enabled: false
Layout/SpaceInsideReferenceBrackets:
Enabled: false
Layout/RedundantLineBreak:
Enabled: false

# Alignment also considered helpful. And aesthetically pleasing.
Layout/HashAlignment:
Expand Down
11 changes: 11 additions & 0 deletions plugins/ShinyCMS/app/assets/stylesheets/shinycms/main_site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,14 @@ body {
.clear-both {
clear: both;
}

.a11y-hidden {
border: 0;
clip: rect( 0 0 0 0 );
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
</nav>

<footer class="c-sidebar-footer">
Powered by <a title="ShinyCMS <%= ShinyCMS::VERSION %>.<%= ShinyCMS::RELEASE %>"
Powered by <a title="ShinyCMS <%= ShinyCMS::VERSION %>.<%#= ShinyCMS::RELEASE %>"
href="https://shinycms.org/">ShinyCMS</a>
</footer>
155 changes: 100 additions & 55 deletions plugins/ShinyCMS/db/demo_site_data.rb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions plugins/ShinyCMS/lib/shinycms/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ module ShinyCMS
public_constant :VERSION

# Use the start of the git commit SHA as a release identifier
RELEASE = `git show --abbrev=4 --pretty=%h -q`.chomp
public_constant :RELEASE
# RELEASE = `git show --abbrev=4 --pretty=%h -q`.chomp
# public_constant :RELEASE
end
1 change: 1 addition & 0 deletions plugins/ShinyCMS/lib/tasks/support/demo_site_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def other_models
ActsAsTaggableOn::Tagging,

ActiveStorage::Blob,
ActiveStorage::VariantRecord,
ActiveStorage::Attachment
]
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<%= form_for :subscription, url: shiny_lists.list_subscribe_path( list.slug ), method: :post, class: 'subscription_form' do |f| %>
<% unless user_signed_in? %>
<% if show_name_field %>
<%= f.text_field :name, placeholder: t( 'shiny_lists.name' ) %><br>
<%= f.label :name, class: 'a11y-hidden' %><%= f.text_field :name, placeholder: t( 'shiny_lists.name' ) %><br>
<% end %>
<%= f.text_field :email, placeholder: t( 'shiny_lists.email_address' ) %>
<%= f.label :email, class: 'a11y-hidden' %><%= f.text_field :email, placeholder: t( 'shiny_lists.email_address' ) %>
<% if show_name_field %><br><% end %>
<% end %>
<%= f.submit t( 'shiny_lists.subscribe' ), name: nil, class: 'button' %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% name ||= 'search_form' %>
<%= form_with name: name, url: shiny_search.search_path, method: :get, local: true do |f| %>
<%= f.text_field 'query' %>&nbsp;
<%= f.label :query, 'Search', class: 'a11y-hidden' %><%= f.text_field :query %>&nbsp;
<%= f.submit t( 'shiny_search.search.form.search' ), name: nil, class: 'button' %>
<% end %>
Binary file removed public/images/pic01.jpg
Binary file not shown.
Binary file removed public/images/pic02.jpg
Binary file not shown.
Binary file removed public/images/pic03.jpg
Binary file not shown.
Binary file removed public/images/pic04.jpg
Binary file not shown.
11 changes: 11 additions & 0 deletions themes/halcyonic/stylesheets/halcyonic/shinycms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,17 @@ input.long {
width: 30em;
}

.a11y-hidden {
border: 0;
clip: rect( 0 0 0 0 );
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}

// ===== ( undoing sweeping style resets ) =====

blockquote {
Expand Down
4 changes: 2 additions & 2 deletions themes/halcyonic/views/includes/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<h2>Log in</h2>
<%= form_for( :user, url: shinycms.user_session_path, method: :post ) do |f| %>
<div class="field">
<%= f.text_field :login, autocomplete: 'email', placeholder: 'Username or email' %>
<%= f.label :login, class: 'a11y-hidden' %><%= f.text_field :login, autocomplete: 'email', placeholder: 'Username or email' %>
</div>
<div class="field">
<%= f.password_field :password, autocomplete: "current-password", placeholder: 'Password' %>
<%= f.label :password, class: 'a11y-hidden' %><%= f.password_field :password, autocomplete: "current-password", placeholder: 'Password' %>
</div>
<div class="field">
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
Expand Down
2 changes: 1 addition & 1 deletion themes/halcyonic/views/layouts/main_site.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
html5up.net/license
-->

<html>
<html lang="<%= I18n.locale.to_s %>">
<%= render partial: 'includes/head' %>

<body<% unless @page&.default_page? %> class="subpage"<% end %>>
Expand Down
18 changes: 9 additions & 9 deletions themes/halcyonic/views/shiny_pages/pages/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a href="<%= banner_button_url %>" class="button-large"><%= banner_button_text %></a>
</div>
<div class="col-6 col-12-medium imp-medium">
<%= link_to image_tag( banner_image, class: 'banner-image' ), url_for( banner_image ) if banner_image.attached? %>
<%= link_to image_tag( banner_image, alt: banner_img_alt, class: 'banner-image' ), url_for( banner_image ) if banner_image.attached? %>
</div>
</div>
</div>
Expand All @@ -23,7 +23,7 @@

<!-- Feature #1 -->
<section>
<%= link_to image_tag( image1, class: 'bordered-feature-image' ), url_for( image1 ) if image1.attached? %>
<%= link_to image_tag( image1, alt: img1_alt, class: 'bordered-feature-image' ), url_for( image1 ) if image1.attached? %>
<h2>
<%= heading1 %>
</h2>
Expand All @@ -35,7 +35,7 @@

<!-- Feature #2 -->
<section>
<%= link_to image_tag( image2, class: 'bordered-feature-image' ), url_for( image2 ) if image2.attached? %>
<%= link_to image_tag( image2, alt: img2_alt, class: 'bordered-feature-image' ), url_for( image2 ) if image2.attached? %>
<h2>
<%= heading2 %>
</h2>
Expand All @@ -47,7 +47,7 @@

<!-- Feature #3 -->
<section>
<%= link_to image_tag( image3, class: 'bordered-feature-image' ), url_for( image3 ) if image3.attached? %>
<%= link_to image_tag( image3, alt: img3_alt, class: 'bordered-feature-image' ), url_for( image3 ) if image3.attached? %>
<h2>
<%= heading3 %>
</h2>
Expand All @@ -59,7 +59,7 @@

<!-- Feature #4 -->
<section>
<%= link_to image_tag( image4, class: 'bordered-feature-image' ), url_for( image4 ) if image4.attached? %>
<%= link_to image_tag( image4, alt: img4_alt, class: 'bordered-feature-image' ), url_for( image4 ) if image4.attached? %>
<h2>
<%= heading4 %>
</h2>
Expand All @@ -83,7 +83,7 @@
<h2>Who We Are</h2>
<h3>A subheading about who we are</h3>
</header>
<%= image_tag image5 if image5.attached? %>
<%= image_tag image5, alt: img5_alt if image5.attached? %>
<p>
Duis neque nisi, dapibus sed mattis quis, rutrum accumsan magna sed.
Suspendisse eu varius nibh. Suspendisse vitae magna eget odio amet mollis
Expand Down Expand Up @@ -120,17 +120,17 @@
</header>
<ul class="quote-list">
<li>
<%= image_tag image6 if image6.attached? %>
<%= image_tag image6, alt: img6_alt if image6.attached? %>
<p>"Neque nisidapibus mattis"</p>
<span>Jane Doe, CEO of UntitledCorp</span>
</li>
<li>
<%= image_tag image7 if image7.attached? %>
<%= image_tag image7, alt: img7_alt if image7.attached? %>
<p>"Lorem ipsum consequat!"</p>
<span>John Doe, President of FakeBiz</span>
</li>
<li>
<%= image_tag image8 if image8.attached? %>
<%= image_tag image8, alt: img8_alt if image8.attached? %>
<p>"Magna veroeros amet tempus"</p>
<span>Mary Smith, CFO of UntitledBiz</span>
</li>
Expand Down