Skip to content

Commit de7852b

Browse files
committed
styling/Hide sidebar on mobile
1 parent 920935d commit de7852b

File tree

3 files changed

+29
-58
lines changed

3 files changed

+29
-58
lines changed

app/assets/stylesheets/helpers.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626

2727
// DISPLAY
2828

29-
.block { display: block; }
30-
.inline-block { display: inline-block; }
31-
.hidden { display: none !important; }
3229
.selected {
3330
background-color: $color-light;
3431

app/views/layouts/application.html.erb

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,6 @@
3333
<%= render partial: 'shared/toast' %>
3434
<%= render partial: 'shared/topbar' %>
3535

36-
<!--
37-
This example requires Tailwind CSS v2.0+
38-
39-
This example requires some changes to your config:
40-
41-
```
42-
// tailwind.config.js
43-
module.exports = {
44-
// ...
45-
plugins: [
46-
// ...
47-
require('@tailwindcss/forms'),
48-
]
49-
}
50-
```
51-
-->
5236
<div class="max-w-6xl mx-auto py-4 sm:px-6 lg:px-8">
5337
<div class="min-h-screen bg-gray-100">
5438
<!-- When the mobile menu is open, add `overflow-hidden` to the `body` element to prevent double scrollbars -->
@@ -58,35 +42,7 @@
5842
<main class="lg:col-span-9 xl:col-span-9">
5943
<%= yield %>
6044
</main>
61-
<aside class="xl:block xl:col-span-3">
62-
<div class="sticky position-sticky--topbar space-y-4">
63-
<% if user_signed_in? %>
64-
<%=
65-
button_tag(
66-
'NEW SNIPPET',
67-
class: 'w-full button--cta-primary flex justify-center',
68-
data: {
69-
controller: 'modal',
70-
action: 'modal#present',
71-
modal_url_value: new_modals_snippet_path(folder_id: new_snippet_folder_id)
72-
}
73-
)
74-
%>
75-
<% else %>
76-
<div class="flex justify-center">
77-
<%= button_tag('LOG IN', type: :button, class: "flex-1 flex justify-center button--cta-tertiary", data: { controller: "modal", modal_url_value: sign_in_modals_users_path, action: "click->modal#present" }) %>
78-
<%= button_tag('SIGN UP', type: :button, class: "flex-1 flex justify-center button--cta-primary ml-2", data: { controller: "modal", modal_url_value: sign_up_modals_users_path, action: "click->modal#present" }) %>
79-
</div>
80-
<% end %>
81-
82-
<%= render partial: 'shared/connect' %>
83-
84-
<%# <%= render 'shared/cards/card' do %>
85-
<%# <h4 class="text-center">Popular</h4> %>
86-
<%# <% end %>
87-
88-
</div>
89-
</aside>
45+
<%= render partial: 'shared/sidebar' %>
9046
</div>
9147
</div>
9248
</div>

app/views/shared/_sidebar.html.erb

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1-
<div class="sidebar--wrapper">
2-
<div class="card--container card--container-padding text-center margin-bottom">
3-
<span class="bold"><%= @page_title.upcase %></span>
4-
</div>
5-
6-
<div class="flex justify-center">
7-
<%= link_to('NEW SNIPPET', @modal_url, data: { controller: 'modal', action: 'modal#present', modal_url_value: @modal_url }, class: 'button--sidebar') %>
8-
</div>
1+
<aside class="hidden lg:block xl:col-span-3 md:col-span-3">
2+
<div class="sticky position-sticky--topbar space-y-4">
3+
<% if user_signed_in? %>
4+
<%=
5+
button_tag(
6+
'NEW SNIPPET',
7+
class: 'w-full button--cta-primary flex justify-center',
8+
data: {
9+
controller: 'modal',
10+
action: 'modal#present',
11+
modal_url_value: new_modals_snippet_path(folder_id: new_snippet_folder_id)
12+
}
13+
)
14+
%>
15+
<% else %>
16+
<div class="flex justify-center">
17+
<%= button_tag('LOG IN', type: :button, class: "flex-1 flex justify-center button--cta-tertiary", data: { controller: "modal", modal_url_value: sign_in_modals_users_path, action: "click->modal#present" }) %>
18+
<%= button_tag('SIGN UP', type: :button, class: "flex-1 flex justify-center button--cta-primary ml-2", data: { controller: "modal", modal_url_value: sign_up_modals_users_path, action: "click->modal#present" }) %>
19+
</div>
20+
<% end %>
21+
22+
<%= render partial: 'shared/connect' %>
923

10-
<%= render partial: 'shared/connect', locals: { users_for_connect: @users_for_connect }%>
11-
</div>
24+
<div>
25+
<p class="text-center text-xs text-gray-500">by <%= link_to '@lewisyoul', 'https://twitter.com/lewisyoul', target: '_blank', class: 'hover:underline' %></p>
26+
</div>
27+
28+
</div>
29+
</aside>

0 commit comments

Comments
 (0)