Skip to content

Commit 8e6a8bb

Browse files
committed
faucet-ify
Steal some code from the faucet documentation to make it look nicer
1 parent 0a29060 commit 8e6a8bb

File tree

16 files changed

+3327
-15
lines changed

16 files changed

+3327
-15
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@
2727

2828
# Ignore master key for decrypting credentials and more.
2929
/config/master.key
30+
31+
/node_modules

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
2424
# Reduces boot times through caching; required in config/boot.rb
2525
gem "bootsnap", require: false
2626

27+
# Use faucet as the asset pipeline
28+
gem "faucet_pipeline_rails"
29+
2730
group :development, :test do
2831
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
2932
gem "debug", platforms: %i[ mri mingw x64_mingw ]

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ GEM
8888
reline (>= 0.2.7)
8989
digest (3.1.0)
9090
erubi (1.10.0)
91+
faucet_pipeline_rails (1.0.1)
92+
rails (>= 4.2.10)
9193
globalid (1.0.0)
9294
activesupport (>= 5.0)
9395
i18n (1.10.0)
@@ -187,6 +189,7 @@ DEPENDENCIES
187189
bootsnap
188190
capybara
189191
debug
192+
faucet_pipeline_rails
190193
puma (~> 5.0)
191194
rails (~> 7.0.2, >= 7.0.2.2)
192195
sqlite3 (~> 1.4)

app/assets/images/logo.png

46.1 KB
Loading

app/assets/javascripts/application.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("Hello World");

app/assets/stylesheets/_base.scss

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
@font-face {
2+
font-family: "Titillium Web";
3+
font-weight: 400;
4+
src: asset-url("titillium-web-regular.woff2") format("woff2");
5+
font-display: swap;
6+
}
7+
8+
@font-face {
9+
font-family: "Titillium Web";
10+
font-weight: 700;
11+
src: asset-url("titillium-web-bold.woff2") format("woff2");
12+
font-display: swap;
13+
}
14+
15+
html {
16+
font-size: var(--base-font-size);
17+
line-height: var(--base-line-height);
18+
}
19+
20+
body {
21+
font-family: "Titillium Web", sans-serif;
22+
color: var(--text-color);
23+
max-width: var(--wrapper-max-width);
24+
margin: 0 var(--wrapper-margin) var(--spacer-xl);
25+
}
26+
27+
h1,
28+
h2 {
29+
margin: var(--base-heading-margin);
30+
line-height: var(--base-line-height);
31+
}
32+
33+
p,
34+
blockquote,
35+
ul {
36+
margin: var(--base-block-margin);
37+
}
38+
39+
li {
40+
margin-bottom: var(--spacer-xs);
41+
}
42+
43+
blockquote {
44+
border-left: var(--highlight-border);
45+
padding-left: 1rem;
46+
}
47+
48+
a {
49+
color: var(--link-color);
50+
transition: color ease-in-out 0.2s;
51+
52+
&:hover,
53+
&:focus {
54+
color: var(--link-color-hover);
55+
}
56+
}
57+
58+
video,
59+
img {
60+
max-width: 100%;
61+
height: auto;
62+
}

app/assets/stylesheets/_settings.scss

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
$black: #1f1f1f;
2+
$dark-gray: #444;
3+
$light-gray: #666;
4+
$white: #FFF;
5+
$blue: #37375F;
6+
$red: #B7455F;
7+
8+
:root {
9+
--base-font-size: 100%; // ~16px
10+
--base-line-height: 1.75;
11+
--tight-line-height: 1.2;
12+
13+
--spacer-xxs: 0.25rem;
14+
--spacer-xs: 0.5rem;
15+
--spacer-s: 0.75rem;
16+
--spacer-m: 1rem;
17+
--spacer-l: 1.25rem;
18+
--spacer-xl: 1.5rem;
19+
20+
--base-border-radius: 5px;
21+
22+
--base-block-margin: 0 0 var(--spacer-xs);
23+
--base-heading-margin: var(--spacer-xl) 0 var(--spacer-xxs);
24+
25+
--main-color: #{$blue};
26+
--link-color: #{$red};
27+
--link-color-hover: #{$blue};
28+
--text-color: #{$black};
29+
--text-color-bright: #{$dark-gray};
30+
--text-color-brighter: #{$light-gray};
31+
--background-color: #{$white};
32+
--highlight-background: #{$red}CC;
33+
--highlight-border: 4px solid #{$blue}CC;
34+
35+
--site-nav-order: 1;
36+
--main-base-width: 320px; // TODO: Figure out a good value here
37+
--tagline-font-size: 1.2rem;
38+
--wrapper-max-width: 100%;
39+
--wrapper-margin: var(--spacer-xs);
40+
41+
@media screen and (min-width: 64em) {
42+
--base-font-size: 112.5%; // ~18px (from a default of 16px)
43+
}
44+
45+
@media screen and (min-width: 760px) {
46+
--tagline-font-size: 2rem;
47+
--site-nav-order: -1;
48+
}
49+
50+
@media screen and (min-width: 820px) {
51+
--wrapper-max-width: 90%;
52+
--wrapper-margin: auto;
53+
}
54+
55+
@media screen and (min-width: 900px) {
56+
--tagline-font-size: 3rem;
57+
}
58+
}

app/assets/stylesheets/application.css

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@use "normalize.css/normalize";
2+
@use "./settings";
3+
@use "./base";

app/views/layouts/application.html.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
<%= csp_meta_tag %>
88

99
<%= stylesheet_link_tag "application" %>
10+
<%= javascript_include_tag "application", type: "module" %>
1011
</head>
1112

1213
<body>
14+
<%= image_tag "logo.png", width: "512", height: "512" %>
1315
<%= yield %>
1416
</body>
1517
</html>

0 commit comments

Comments
 (0)