html: standardize font sizes and heading tags.

Standardize font sizes and heading tags (<h1>-<h6>) to be more
consistent across the site.

Changes:

* Introduce font size CSS variables and start replacing hardcoded font
  sizes with standard sizes.
* Change header tags to use only one <h1> per page. One <h1> per page is
  recommended for SEO purposes. Usually this is for the page title, like
  in forum threads or wiki pages.
* Standardize on <h2> for section headers in sidebars and <h3> for
  smaller subsection headers. Don't use <h4>-<h6>.
* In DText, make h1-h4 headers all the same size. Standard wiki style is
  to ignore h1-h3 and start at h4.
* In DText, make h4-h6 the same size as the h1-h3 tags outside of DText.
* In the tag list, change the <h1> and <h2> tag category headers to <h3>.
* Make usernames in comments and forum posts smaller. Also change the
  <h4> tag for the commenter name to <div class="author-name">.
* Make the tag list, paginator, and nav menu smaller on mobile.
* Change h1#app-name-header to a#app-name-header.
This commit is contained in:
evazion
2020-07-17 13:05:40 -05:00
parent a59afcdf29
commit 3a3d456bd2
37 changed files with 83 additions and 123 deletions

View File

@@ -12,7 +12,6 @@
</ul>
<div style="margin: 1em 0;">
<h2>Script</h2>
<div class="prose">
<%= format_text @bulk_update_request.processor.to_dtext %>
</div>

View File

@@ -17,12 +17,12 @@
<% end %>
data-is-voted="<%= comment.voted_by?(CurrentUser.user) %>">
<div class="author">
<h4>
<div class="author-name">
<%= link_to_user comment.creator %>
<% if comment.is_deleted? %>
(deleted)
<% end %>
</h4>
</div>
<%= link_to time_ago_in_words_tagged(comment.created_at), post_path(comment.post, anchor: "comment_#{comment.id}"), class: "message-timestamp" %>
</div>
<div class="content">

View File

@@ -4,8 +4,7 @@
<div id="c-dmails">
<div id="a-show">
<div class="dmail">
<h1>Show Message</h1>
<h2><%= @dmail.title %></h2>
<h1><%= @dmail.title %></h1>
<ul style="margin-bottom: 1em;">
<li><strong>Sender</strong>: <%= link_to_user @dmail.from %></li>
@@ -13,7 +12,6 @@
<li><strong>Date</strong>: <%= compact_time(@dmail.created_at) %></li>
</ul>
<h3>Body</h3>
<div class="prose">
<%= format_text(@dmail.body) %>

View File

@@ -6,12 +6,12 @@
<% end %>
data-creator="<%= forum_post.creator.name %>">
<div class="author">
<h4>
<div class="author-name">
<%= link_to_user forum_post.creator %>
<% if forum_post.is_deleted? %>
(deleted)
<% end %>
</h4>
</div>
<%= link_to time_ago_in_words_tagged(forum_post.created_at), forum_post, class: "message-timestamp" %>
</div>
<div class="content">

View File

@@ -1,2 +1 @@
$("article[data-forum-post-id=<%= @forum_post.id %>] div.author h4").append(" (deleted)");
$("article[data-forum-post-id=<%= @forum_post.id %>] div.author div.author-name").append(" (deleted)");

View File

@@ -50,7 +50,7 @@
<%= render "news_updates/listing" %>
<header id="top">
<h1 id="app-name-header"><%= link_to Danbooru.config.app_name, "/" %></h1>
<%= link_to Danbooru.config.app_name, root_path, id: "app-name-header", class: "heading" %>
<div id="maintoggle" class="mobile-only">
<a href="#"><i id="maintoggle-on" class="fas fa-bars"></i></a>

View File

@@ -12,7 +12,7 @@
<%= render "posts/partials/index/blacklist" %>
<p id="modqueue-sidebar-status" class="sidebar-section">
<h6>Status</h6>
<h2>Status</h2>
<ul>
<li>
<%= link_to "status:pending", modqueue_index_path(search: { tags: "status:pending" }) %>
@@ -33,7 +33,7 @@
</p>
<p id="modqueue-sidebar-uploaders" class="sidebar-section">
<h6>Uploaders</h6>
<h2>Uploaders</h2>
<ul>
<% @uploaders.each do |uploader, count| %>
<li>
@@ -46,7 +46,7 @@
</p>
<p id="modqueue-sidebar-tags" class="sidebar-section">
<h6>Tags</h6>
<h2>Tags</h2>
<%= render "tag_list", tags: @artist_tags %>
<%= render "tag_list", tags: @copyright_tags %>

View File

@@ -6,7 +6,7 @@
<%= render "posts/partials/index/blacklist" %>
<section id="tag-box">
<h1>Tags</h1>
<h2>Tags</h2>
<%= @post_set.tag_list_html(current_query: params[:tags], show_extra_links: policy(Post).show_extra_links?) %>
</section>

View File

@@ -1,7 +1,7 @@
<%# path, tags %>
<section id="search-box">
<h1>Search</h1>
<h2>Search</h2>
<%= form_tag(path, method: "get", id: "search-box-form") do %>
<% if params[:random] %>
<%= hidden_field_tag :random, params[:random] %>

View File

@@ -1,5 +1,5 @@
<div id="blacklist-box" class="sidebar-blacklist">
<h1>Blacklisted (<%= link_to_wiki "help", "help:blacklists" %>)</h1>
<h2>Blacklisted (<%= link_to_wiki "help", "help:blacklists" %>)</h2>
<ul id="blacklist-list" class="list-bulleted"></ul>
<%= link_to "Disable all", "#", :id => "disable-all-blacklists", :style => "display: none;" %>
<%= link_to "Re-enable all", "#", :id => "re-enable-all-blacklists", :style => "display: none;" %>

View File

@@ -1,5 +1,5 @@
<div id="quick-edit-div" style="display: none;">
<h1>Edit</h1>
<h2>Edit</h2>
<%= edit_form_for(:post, html: { id: "quick-edit-form" }) do |f| %>
<%= f.input :tag_string, label: "Tags", as: :text, input_html: { "data-autocomplete": "tag-edit" } %>

View File

@@ -40,13 +40,13 @@
<% end %>
<% elsif post_set.pool.present? %>
<% post_set.pool.tap do |pool| %>
<h4>
<h2>
<%= pool.pretty_category %>:
<%= link_to pool.pretty_name, pool_path(pool), :class => "pool-category-#{pool.category}" %>
<% if pool.is_deleted? %>
<span class="inactive">(deleted)</span>
<% end %>
</h4>
</h2>
<div id="description" class="prose">
<%= format_text(post_set.pool.description) %>
@@ -57,10 +57,10 @@
</p>
<% end %>
<% elsif post_set.favgroup.present? %>
<h4>
<h2>
Favorite Group:
<%= link_to post_set.favgroup.pretty_name, favorite_group_path(post_set.favgroup) %>
</h4>
</h2>
Creator: <%= link_to_user post_set.favgroup.creator %>
<% elsif post_set.has_blank_wiki? %>
<p>There is currently no wiki page for the tag <%= link_to_wiki post_set.tag.pretty_name %>. You can <%= link_to "create one", new_wiki_page_path(wiki_page: { title: post_set.tag.name }), rel: "nofollow" %>.</p>

View File

@@ -1,6 +1,6 @@
<% if policy(Post).can_use_mode_menu? %>
<section id="mode-box">
<h1>Mode</h1>
<h2>Mode</h2>
<form action="/">
<select name="mode">
<option value="view">View</option>

View File

@@ -1,5 +1,5 @@
<section id="options-box">
<h1>Options</h1>
<h2>Options</h2>
<ul>
<% if policy(SavedSearch).create? %>
<li><%= button_tag(tag.i(class: "fas fa-bookmark") + " Save search", id: "save-search", class: "ui-button ui-widget ui-corner-all sub") %></li>

View File

@@ -1,5 +1,5 @@
<section id="related-box">
<h1>Related</h1>
<h2>Related</h2>
<ul id="related-list">
<% if discover_mode? %>
<li id="secondary-links-posts-hot"><%= link_to "Hot", posts_path(:tags => "order:rank") %></li>

View File

@@ -15,17 +15,17 @@
</section>
<section id="post-information">
<h1>Information</h1>
<h2>Information</h2>
<%= render "posts/partials/show/information", :post => @post %>
</section>
<section id="post-options">
<h1>Options</h1>
<h2>Options</h2>
<%= render "posts/partials/show/options", :post => @post %>
</section>
<section id="post-history">
<h1>History</h1>
<h2>History</h2>
<ul>
<li id="post-history-tags"><%= link_to "Tags", post_versions_path(search: { post_id: @post.id }) %></li>
<li id="post-history-pools"><%= link_to "Pools", pool_versions_path(search: { post_id: @post.id }) %></li>

View File

@@ -3,7 +3,7 @@
<%= render "related_tags/tag_column", tags: source.translated_tags.map(&:name), title: "Translated Tags" %>
<div class="tag-column wide-column artist-related-tags-column">
<h6>Artist</h6>
<h3>Artist</h3>
<% if source.artists.size == 0 %>
none

View File

@@ -2,7 +2,7 @@
<%= content_tag(:div, class: ["tag-column", local_assigns[:class] || "#{title.parameterize}-related-tags-column", "is-empty-#{tags.empty?}"].join(" ")) do %>
<% if tags.present? %>
<h6><%= title %></h6>
<h3><%= title %></h3>
<%= TagSetPresenter.new(tags).tag_list_html(name_only: true) %>
<% end %>
<% end %>

View File

@@ -4,6 +4,6 @@
<p><%= @message %></p>
<% unless @expected %>
<h6>Details</h6>
<h3>Details</h3>
<%= render "static/backtrace", exception: @exception, backtrace: @backtrace %>
<% end %>

View File

@@ -6,7 +6,7 @@
<p>Your search took too long to execute and was cancelled.</p>
<h6>Why did this happen?</h6>
<h3>Why did this happen?</h3>
<p>
Some kinds of searches are slower than others. If your search is too slow
@@ -15,7 +15,7 @@
</p>
<% if params[:controller] == "posts" && params[:action] == "index" && params[:tags].present? %>
<h6>What can I do?</h6>
<h3>What can I do?</h3>
<p>Try changing your search:</p>
@@ -38,7 +38,7 @@
<% end %>
<% if !CurrentUser.is_gold? %>
<h6>Search limits</h6>
<h3>Search limits</h3>
<p>
Members are limited to searches that take up to 3 seconds long. You can

View File

@@ -4,7 +4,7 @@
<div id="a-site-map" class="fixed-width-container">
<section>
<ul>
<li><h1>Posts</h1></li>
<li><h2>Posts</h2></li>
<li><%= link_to_wiki "Help", "help:posts" %></li>
<li><%= link_to("Listing", posts_path) %></li>
<li><%= link_to("Upload", new_upload_path) %></li>
@@ -18,7 +18,7 @@
<% end %>
</ul>
<ul>
<li><h1>Post Events</h1></li>
<li><h2>Post Events</h2></li>
<li><%= link_to("Changes", post_versions_path) %></li>
<li><%= link_to("Approvals", post_approvals_path) %></li>
<li><%= link_to("Disapprovals", post_disapprovals_path) %></li>
@@ -27,7 +27,7 @@
<li><%= link_to("Replacements", post_replacements_path) %></li>
</ul>
<ul>
<li><h1>Tools</h1></li>
<li><h2>Tools</h2></li>
<li><%= link_to("Source Code", Danbooru.config.source_code_url) %></li>
<li><%= link_to("Bug Reports", Danbooru.config.issues_url) %></li>
<li><%= link_to("Keyboard Shortcuts", keyboard_shortcuts_path) %></li>
@@ -37,7 +37,7 @@
<li><%= link_to("Similar Images Search", iqdb_queries_path) %></li>
</ul>
<ul>
<li><h1>Artists</h1></li>
<li><h2>Artists</h2></li>
<li><%= link_to_wiki "Help", "help:artists" %></li>
<li><%= link_to("Listing", artists_path) %></li>
<li><%= link_to("Banned", banned_artists_path) %></li>
@@ -46,7 +46,7 @@
</section>
<section>
<ul>
<li><h1>Tags</h1></li>
<li><h2>Tags</h2></li>
<li><%= link_to_wiki "Help", "help:tags" %></li>
<li><%= link_to_wiki "Cheat sheet", "help:cheatsheet" %></li>
<li><%= link_to("Aliases", tag_aliases_path) %></li>
@@ -54,14 +54,14 @@
<li><%= link_to("Listing", tags_path) %></li>
</ul>
<ul>
<li><h1>Notes</h1></li>
<li><h2>Notes</h2></li>
<li><%= link_to_wiki "Help", "help:notes" %></li>
<li><%= link_to("Listing", notes_path) %></li>
<li><%= link_to("Search", search_notes_path) %></li>
<li><%= link_to("Changes", note_versions_path) %></li>
</ul>
<ul>
<li><h1>Pools</h1></li>
<li><h2>Pools</h2></li>
<li><%= link_to_wiki "Help", "help:pools" %></li>
<li><%= link_to("Listing", pools_path) %></li>
<li><%= link_to("Gallery", gallery_pools_path) %></li>
@@ -70,7 +70,7 @@
<% end %>
</ul>
<ul>
<li><h1>Reports</h1></li>
<li><h2>Reports</h2></li>
<li><%= link_to("Performance Reports", "https://isshiki.donmai.us/user-reports") %></li>
<li><%= link_to("Top Searches", searches_explore_posts_path) %></li>
<li><%= link_to("Missed Searches", missed_searches_explore_posts_path) %></li>
@@ -78,7 +78,7 @@
</section>
<section>
<ul>
<li><h1>Comments</h1></li>
<li><h2>Comments</h2></li>
<li><%= link_to_wiki "Help", "help:comments" %></li>
<li><%= link_to("Listing", comments_path) %></li>
<li><%= link_to("Search", search_comments_path) %></li>
@@ -86,7 +86,7 @@
<li><%= link_to("RSS", comments_path(:atom)) %></li>
</ul>
<ul>
<li><h1>Forum</h1></li>
<li><h2>Forum</h2></li>
<li><%= link_to_wiki "Help", "help:forum" %></li>
<li><%= link_to("Listing", forum_topics_path) %></li>
<li><%= link_to("Search", search_forum_posts_path) %></li>
@@ -94,14 +94,14 @@
<li><%= link_to("RSS", forum_topics_path(:atom)) %></li>
</ul>
<ul>
<li><h1>Wiki</h1></li>
<li><h2>Wiki</h2></li>
<li><%= link_to_wiki "Help", "help:wiki" %></li>
<li><%= link_to("Listing", wiki_pages_path) %></li>
<li><%= link_to("Search", search_wiki_pages_path) %></li>
<li><%= link_to("Changes", wiki_page_versions_path) %></li>
</ul>
<ul>
<li><h1>Artist commentary</h1></li>
<li><h2>Artist commentary</h2></li>
<li><%= link_to_wiki "Help", "help:artist_commentary" %></li>
<li><%= link_to("Listing", artist_commentaries_path) %></li>
<li><%= link_to("Search", search_artist_commentaries_path) %></li>
@@ -110,7 +110,7 @@
</section>
<section>
<ul>
<li><h1>Profile</h1></li>
<li><h2>Profile</h2></li>
<% if CurrentUser.is_anonymous? %>
<li><%= link_to "Login", login_path %></li>
<li><%= link_to "Sign up", new_user_path %></li>
@@ -128,7 +128,7 @@
<li><%= link_to "Upgrade information", new_user_upgrade_path %></li>
</ul>
<ul>
<li><h1>Users</h1></li>
<li><h2>Users</h2></li>
<% if CurrentUser.is_moderator? %>
<li><%= link_to("Dashboard", moderator_dashboard_path) %></li>
<% end %>
@@ -141,7 +141,7 @@
<li><%= link_to("Privacy Policy", privacy_policy_path) %></li>
</ul>
<ul>
<li><h1>Admin</h1></li>
<li><h2>Admin</h2></li>
<li><%= link_to("Mod Actions", mod_actions_path) %></li>
<li><%= link_to("Jobs", delayed_jobs_path) %></li>
<li><%= link_to("Bulk Update Requests", bulk_update_requests_path) %></li>

View File

@@ -1,5 +1,5 @@
<section>
<h1>Recent Changes (<%= link_to "all", wiki_page_versions_path %>)</h1>
<h2>Recent Changes (<%= link_to "all", wiki_page_versions_path %>)</h2>
<ul>
<% WikiPage.order(updated_at: :desc).includes(:tag).limit(25).each do |page| %>
<li><%= link_to page.pretty_title, wiki_page_path(page), class: tag_class(page.tag) %></li>

View File

@@ -3,7 +3,7 @@
<%= render "wiki_pages/recent_changes" %>
<% if @wiki_page.present? %>
<h4>Options</h4>
<h2>Options</h2>
<ul>
<% unless @wiki_page.is_meta_wiki? %>