Skip to content

Commit

Permalink
Correção no grid do CSS (#105)
Browse files Browse the repository at this point in the history
* style(custom.css): altera a cor de fundo para #11191f
style(custom.css): adiciona classe .grid com grid-template-columns: repeat(3, 1fr)
style(custom.css): adiciona classe .navbar com background: #fff
style(custom.css): remove a classe .contents article
style(custom.css): remove o seletor footer
view(contents/_content.html.erb): remove a seção e a classe .contents
view(contents/_content.html.erb): adiciona a classe .grid e remove a seção
spec(features/visits_home_page_spec.rb): atualiza os seletores para refletir as mudanças na view

* feat(logo.png): adiciona o arquivo de imagem do logo
style(custom.css): organizando css e resolvendo problema de estruturação
view(contents/show.html.erb): remove a classe .contents da div .grid
view(layouts/application.html.erb): altera o valor do atributo data-theme para dark
view(shared/_navbar.html.erb): adiciona a classe .navbar para a div externa
  • Loading branch information
marcuxyz authored Jul 29, 2023
1 parent eb2e1d1 commit 85cf3fb
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 52 deletions.
Binary file added app/assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 21 additions & 16 deletions app/assets/stylesheets/custom.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
html,
body {
display : flex;
min-height : 100vh;
flex-direction: column;
display : flex;
min-height : 100vh;
flex-direction : column;
background-color: #11191f !important;
}

main {
flex: 1;
}

.grid.contents {
grid-template-columns: repeat(3, 1fr) !important;
}

.navbar strong {
color: #fff;
}

nav ul li strong {
margin-left: 5px;
}

ion-icon {
font-size: 30px;
color: #fff;
}

[data-category]:before {
Expand All @@ -34,23 +44,19 @@ ion-icon {
line-height : 1;
}

.contents article {
position: relative;
height : 23vh;
}

a {
color : #000 !important;
text-decoration: none;
color : aliceblue;
}

a:hover {
color: rgb(216, 232, 248);
text-decoration: none;

}

.avatar {
width : 78px;
height : auto;
width : 78px;
height: auto;
}

.text-right {
Expand All @@ -65,17 +71,16 @@ a:hover {
display : grid;
justify-content: center;
align-items : center;
min-height : 18vh;
height : 279px !important;
position : relative !important;
}

th,
td {
text-align: center;
}


footer {
background-color: #18242c;
}
footer p {
color: #fff !important;
}
20 changes: 9 additions & 11 deletions app/views/contents/_content.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<section class="contents">
<% contents.each_slice(3) do |contents| %>
<div class="grid">
<% contents.each do |content| %>
<a class="published_content" href="<%= content_path(content) %>">
<article data-category="<%= content.category.name %>">
<h5> <%= content.name %> </h5>
</article>
</a>
<% end %>
<div class='grid contents'>
<% contents.each do |content| %>
<div>
<a class='published_content' href='<%= content_path(content) %>'>
<article data-category='<%= content.category.name %>'>
<h5><%= content.name %></h5>
</article>
</a>
</div>
<% end %>
</section>
</div>
6 changes: 3 additions & 3 deletions app/views/contents/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<section>
<div class="grid contents">
<div class="grid">
<div>
<article>
<h3 class="text-center"><%= @content.name %></h3>
Expand All @@ -8,7 +8,7 @@
</div>

<% if @content.embeded_video.html_safe.present? %>
<div class="grid contents">
<div class="grid">
<div>
<%= @content.embeded_video.html_safe %>
</div>
Expand All @@ -17,7 +17,7 @@
</section>

<section>
<div class="grid contents">
<div class="grid">
<div>
<p>
<%= @content.body %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="pt-BR" data-theme="light">
<html lang="pt-BR" data-theme="dark">
<head>
<title>Negrosdev</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
Expand Down
38 changes: 20 additions & 18 deletions app/views/shared/_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<div class="container">
<nav>
<ul class="text-center">
<li>
<a href="<%= root_path %>">
<%= image_tag 'logo.svg', { class: 'avatar', alt: "Negros.dev" } %>
<strong>negros.dev</strong>
</a>
</li>
</ul>
<ul>
<li>
<a href="https://github.com/marcuxyz/">
<ion-icon name="logo-github"></ion-icon>
</a>
</li>
</ul>
</nav>
<div class="navbar">
<div class="container">
<nav>
<ul class="text-center">
<li>
<a href="<%= root_path %>">
<%= image_tag 'logo.png', { class: 'avatar', alt: "Negros.dev" } %>
<strong>negros.dev</strong>
</a>
</li>
</ul>
<ul>
<li>
<a href="https://github.com/marcuxyz/">
<ion-icon name="logo-github"></ion-icon>
</a>
</li>
</ul>
</nav>
</div>
</div>
6 changes: 3 additions & 3 deletions spec/features/visits_home_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@

visit root_path

within 'section.contents > div:nth-child(1) > a:nth-child(1)' do
within 'section > div > div:nth-child(1) > a > article' do
expect(page).to have_content('About Remix framework')
end
within 'section.contents > div:nth-child(1) > a:nth-child(2)' do
within 'section > div > div:nth-child(2) > a > article' do
expect(page).to have_content('Ruby On Rails - Configure Active Record')
end
within 'section.contents > div:nth-child(1) > a:nth-child(3)' do
within 'section > div > div:nth-child(3) > a > article' do
expect(page).to have_content('OOP With Ruby')
end
end
Expand Down

0 comments on commit 85cf3fb

Please sign in to comment.