Skip to content

Commit 53a6003

Browse files
committed
scss files restructured
1 parent d1a2715 commit 53a6003

File tree

12 files changed

+107
-111
lines changed

12 files changed

+107
-111
lines changed

app/assets/javascripts/application.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
//
1313
//= require rails-ujs
1414
//= require turbolinks
15-
//= require_tree .
16-
1715
//= require jquery3
1816
//= require popper
1917
//= require bootstrap-sprockets
18+
//= require_tree .

app/assets/stylesheets/application.scss

+6-20
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,14 @@
1010
* files in this directory. Styles in this file should be added after the last require_* statement.
1111
* It is generally better to create a new file per style scope.
1212
*
13-
*= require_tree .
1413
*= require_self
14+
*= require_tree .
1515
*/
1616

17+
// Changed the order of `require_self` and `require_tree` so that bootstrap and application wide
18+
// styles are loaded before controller specific styles.
19+
// However, try to keep the styles as less cascaded as possible, and order of included files wont matter.
1720

18-
// Custom bootstrap variables must be set or imported *before* bootstrap.
19-
@import "bootstrap";
20-
@import "root";
21-
22-
23-
.footer {
24-
position: absolute;
25-
bottom: 0;
26-
width: 100%;
27-
height: 60px;
28-
line-height: 60px;
29-
background-color: #f5f5f5;
30-
color: #111;
31-
}
3221

33-
.center-block {
34-
display: block;
35-
margin-right: auto;
36-
margin-left: auto;
37-
}
22+
// Custom bootstrap variables must be set or imported *before* bootstrap.
23+
@import "bootstrap";

app/assets/stylesheets/campaigns.scss

-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
.campaigns-show {
2-
.btn a { color: #eee; }
3-
}

app/assets/stylesheets/commons.scss

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.topnav-search {
2+
.btn {
3+
display: none;
4+
}
5+
}
6+
7+
8+
.footer {
9+
width: 100%;
10+
height: 60px;
11+
line-height: 60px;
12+
background-color: #f5f5f5;
13+
color: #111;
14+
}
15+
16+
.center-block {
17+
display: block;
18+
margin-right: auto;
19+
margin-left: auto;
20+
}

app/assets/stylesheets/root.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,4 @@ html, .root-index {
155155
width: 42rem;
156156
}
157157
}
158-
}
158+
}

app/assets/stylesheets/scaffolds.scss

-46
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,3 @@
1-
body {
2-
background-color: #fff;
3-
color: #333;
4-
margin: 33px;
5-
font-family: verdana, arial, helvetica, sans-serif;
6-
font-size: 13px;
7-
line-height: 18px;
8-
}
9-
10-
p, ol, ul, td {
11-
font-family: verdana, arial, helvetica, sans-serif;
12-
font-size: 13px;
13-
line-height: 18px;
14-
}
15-
16-
pre {
17-
background-color: #eee;
18-
padding: 10px;
19-
font-size: 11px;
20-
}
21-
22-
a {
23-
color: #000;
24-
25-
&:visited {
26-
color: #666;
27-
}
28-
29-
&:hover {
30-
color: #fff;
31-
background-color: #000;
32-
}
33-
}
34-
35-
th {
36-
padding-bottom: 5px;
37-
}
38-
39-
td {
40-
padding: 0 5px 7px;
41-
}
42-
431
div {
442
&.field, &.actions {
453
margin-bottom: 10px;
@@ -78,7 +36,3 @@ div {
7836
list-style: square;
7937
}
8038
}
81-
82-
label {
83-
display: block;
84-
}
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// styles that remove undo default bootstrap styles
2+
3+
body {
4+
font-family: Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
5+
}
6+
7+
.navbar {
8+
font-weight: bold;
9+
align-items: flex-end;
10+
padding-top: 1rem;
11+
padding-bottom: 1rem;
12+
margin-bottom: 1.5rem;
13+
}
14+
15+
.navbar-collapse {
16+
align-items: flex-end;
17+
}
18+
19+
@media (min-width: 768px) {
20+
.navbar-expand-md .navbar-nav .nav-link {
21+
padding-left: 1em;
22+
padding-right: 1em;
23+
}
24+
}
25+
26+
.navbar-light .navbar-brand {
27+
color: #DB0808;
28+
font-size: 1.5rem;
29+
}

app/views/campaigns/show.html.erb

+35-19
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,43 @@
1-
<div class="container">
2-
<div class="row center-block">
3-
<h1>
4-
<div class="col-xs-12 col-centered">
5-
<%= @campaign.title %>
6-
</div>
7-
</h1>
1+
<nav class="navbar navbar-expand-md navbar-light bg-white">
2+
<a class="navbar-brand" href="#">GlarnerCrowd</a>
3+
<button class="navbar-toggler" type="button" data-toggle="collapse"
4+
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
5+
aria-label="Toggle navigation">
6+
<span class="navbar-toggler-icon"></span>
7+
</button>
8+
<div class="collapse navbar-collapse" id="navbarSupportedContent">
9+
<ul class="navbar-nav mr-auto">
10+
<li class="nav-item active">
11+
<a class="nav-link" href="#">Start a Project <span class="sr-only">(current)</span></a>
12+
</li>
13+
<li class="nav-item">
14+
<a class="nav-link" href="#">About Us</a>
15+
</li>
16+
</ul>
17+
<form class="form-inline my-lg-0 topnav-search">
18+
<input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
19+
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
20+
</form>
821
</div>
22+
</nav>
23+
24+
<div class="container">
25+
<h1><%= @campaign.title %></h1>
26+
927
<div class="row center-block">
10-
<p>
11-
<div class="col-xs-12 col-centered">
12-
<%= @campaign.claim %>
13-
</div>
14-
</p>
28+
<p><%= @campaign.claim %></p>
1529
</div>
1630
<div class="row">
17-
<div class="col-lg-6">
18-
<% unless @campaign.youtube_url.empty? %>
19-
<iframe frameborder="0" height="315" src="<%= @campaign.youtube_url %>" width="560"></iframe>
20-
<% else %>
21-
<img src="http://placekitten.com/g/560/315"/>
22-
<% end %>
31+
<div class="col-md-8">
32+
<div class="embed-responsive embed-responsive-16by9">
33+
<% unless @campaign.youtube_url.empty? %>
34+
<iframe class="embed-responsive-item" height="315" src="<%= @campaign.youtube_url %>" width="560"></iframe>
35+
<% else %>
36+
<img src="http://placekitten.com/g/560/315"/>
37+
<% end %>
38+
</div>
2339
</div>
24-
<div class="col-lg-6">
40+
<div class="col">
2541
<p>
2642
<b>Our funding goal is:</b>
2743
<%= @campaign.goal %>

app/views/layouts/application.html.erb

+11-13
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,31 @@
22
<html lang="<%= I18n.locale.to_s %>">
33
<head>
44
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
5-
<title>Crowdfunding</title>
5+
<title>GlarnerCrowd</title>
6+
67
<%= csrf_meta_tags %>
7-
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
8-
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
8+
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
9+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
910

1011
<% if Rails.env.development? %>
1112
<!-- Global Site Tag (gtag.js) - Google Analytics
1213
-->
1314
<script src="https://www.googletagmanager.com/gtag/js?id=UA-62285904-11"></script>
1415
<script>
15-
1616
function gtag(){dataLayer.push(arguments)};
1717
gtag('js', new Date());
18-
1918
gtag('config', 'UA-62285904-11');
2019
</script>
2120
<% end %>
22-
2321
</head>
22+
2423
<body class="<%= [controller_name, action_name] * '-' %>">
2524
<%= yield %>
25+
<footer class="footer">
26+
<div class="container">
27+
© 200ok LLC &amp; Ungleich LLC 2017
28+
</div>
29+
</footer>
30+
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
2631
</body>
27-
28-
29-
<footer class="footer">
30-
<div class="container">
31-
<span class="muted">© 200ok LLC & Ungleich LLC 2017</span>
32-
</div>
33-
</footer>
3432
</html>

app/views/root/index.html.erb

-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<div class="site-wrapper">
2-
32
<div class="site-wrapper-inner">
4-
53
<div class="cover-container">
6-
74
<div class="masthead clearfix">
85
<div class="inner">
96
<h3 class="masthead-brand">
@@ -42,11 +39,7 @@
4239
</div>
4340
<% end %>
4441
</div>
45-
4642
</div>
47-
4843
</div>
49-
5044
</div>
51-
5245
</div>

config/environments/development.rb

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
# number of complex assets.
4343
config.assets.debug = true
4444

45+
# config.sass.debug_info = true
46+
# config.sass.line_comments = false # source maps don't get output if this is true
47+
# config.assets.digest = false
48+
4549
# Suppress logger output for asset requests.
4650
config.assets.quiet = true
4751

0 commit comments

Comments
 (0)