├── .gitignore ├── .travis.yml ├── Gemfile ├── Gemfile.lock ├── README.md ├── Rakefile ├── config.rb ├── misc └── rg-workbook-interactive.pdf └── source ├── images ├── bentobox.svg ├── flask.svg ├── heart.svg └── ruby.svg ├── index.html.erb └── stylesheets ├── _reset.scss └── workbook.scss /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile ~/.gitignore_global 6 | 7 | # Ignore bundler config 8 | /.bundle 9 | 10 | # Ignore the build directory 11 | /build 12 | 13 | # Ignore cache 14 | /.sass-cache 15 | /.cache 16 | 17 | # Ignore .DS_store file 18 | .DS_Store 19 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | cache: bundler 3 | deploy: 4 | - provider: s3 5 | access_key_id: AKIAJT6ZPTRVSYJDVQTQ 6 | secret_access_key: 7 | secure: gMBpJi7JtUSost3W7kTO5jEYStqZhRuUsl/7uSwPCr9h4DICakoSx3wfdEhDNzrK9JafWxCZR2gk7NiyeG348Tgu5ZZq/ESxsfJgdV82ylXq941ncigBoaeg31vL1It9bMbcfPfQ+HnH2sHHb5fqq4wFz6cSkOVijG2GpnXIvCI= 8 | bucket: railsgirls-workbook 9 | local-dir: build 10 | skip_cleanup: true 11 | region: eu-central-1 12 | acl: public_read 13 | on: 14 | repo: railsgirls/workbook 15 | all_branches: true 16 | - provider: releases 17 | api_key: 18 | secure: AnnFIdic2VDtvpsGsEUVuEgWutV0hNc9QNdc4gV3bVUeI2dMMK3Q55VvG5GSNXNshhUkk7JAij6BV5oJ9y9O4HUNs2EgdUXH4+V7r2YZImOz0tmq2brcoAVt7yRaaghJZQuaHFZoAWwx+BbvAzGhtiUb+VfS8TIBrGueXlkacVU= 19 | file: build/workbook.pdf 20 | skip_cleanup: true 21 | on: 22 | repo: railsgirls/workbook 23 | tags: true 24 | env: 25 | global: 26 | secure: W8dMOTLvgQkCc+B7tfuVSNPwiInJZSpy550tJmfDNdF52v6S3QapXVFdc8q8ngF/qL7hSnFesfm9aQxRZX+gKF/WedWO3jXsNKxguHg9XF1eJMSCEVu8rK2R0UjTKLrzbSNN9hEnqYqJKj5xHhjJwswk+3CpTa47EJbYUGiSquY= 27 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'doc_raptor', '~> 0.3' 4 | gem 'nokogiri', '~> 1.16' 5 | gem 'mimemagic', '~> 0.2' 6 | gem 'rake' 7 | 8 | gem 'middleman', '~>3.3.7' 9 | gem 'middleman-livereload', '~> 3.1.0' 10 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | activesupport (4.1.16) 5 | i18n (~> 0.6, >= 0.6.9) 6 | json (~> 1.7, >= 1.7.7) 7 | minitest (~> 5.1) 8 | thread_safe (~> 0.1) 9 | tzinfo (~> 1.1) 10 | celluloid (0.16.0) 11 | timers (~> 4.0.0) 12 | chunky_png (1.3.3) 13 | coffee-script (2.3.0) 14 | coffee-script-source 15 | execjs 16 | coffee-script-source (1.8.0) 17 | compass (1.0.3) 18 | chunky_png (~> 1.2) 19 | compass-core (~> 1.0.2) 20 | compass-import-once (~> 1.0.5) 21 | rb-fsevent (>= 0.9.3) 22 | rb-inotify (>= 0.9) 23 | sass (>= 3.3.13, < 3.5) 24 | compass-core (1.0.3) 25 | multi_json (~> 1.0) 26 | sass (>= 3.3.0, < 3.5) 27 | compass-import-once (1.0.5) 28 | sass (>= 3.2, < 3.5) 29 | doc_raptor (0.3.2) 30 | httparty (>= 0.7.0) 31 | em-websocket (0.5.1) 32 | eventmachine (>= 0.12.9) 33 | http_parser.rb (~> 0.6.0) 34 | erubis (2.7.0) 35 | eventmachine (1.0.4) 36 | execjs (2.8.1) 37 | ffi (1.15.5) 38 | haml (5.2.2) 39 | temple (>= 0.8.0) 40 | tilt 41 | hike (1.2.3) 42 | hitimes (1.2.2) 43 | hooks (0.4.0) 44 | uber (~> 0.0.4) 45 | http_parser.rb (0.6.0) 46 | httparty (0.21.0) 47 | mini_mime (>= 1.0.0) 48 | multi_xml (>= 0.5.2) 49 | i18n (0.6.11) 50 | json (1.8.6) 51 | kramdown (1.5.0) 52 | listen (2.8.5) 53 | celluloid (>= 0.15.2) 54 | rb-fsevent (>= 0.9.3) 55 | rb-inotify (>= 0.9) 56 | middleman (3.3.7) 57 | coffee-script (~> 2.2) 58 | compass (>= 1.0.0, < 2.0.0) 59 | compass-import-once (= 1.0.5) 60 | execjs (~> 2.0) 61 | haml (>= 4.0.5) 62 | kramdown (~> 1.2) 63 | middleman-core (= 3.3.7) 64 | middleman-sprockets (>= 3.1.2) 65 | sass (>= 3.4.0, < 4.0) 66 | uglifier (~> 2.5) 67 | middleman-core (3.3.7) 68 | activesupport (~> 4.1.0) 69 | bundler (~> 1.1) 70 | erubis 71 | hooks (~> 0.3) 72 | i18n (~> 0.6.9) 73 | listen (>= 2.7.9, < 3.0) 74 | padrino-helpers (~> 0.12.3) 75 | rack (>= 1.4.5, < 2.0) 76 | rack-test (~> 0.6.2) 77 | thor (>= 0.15.2, < 2.0) 78 | tilt (~> 1.4.1, < 2.0) 79 | middleman-livereload (3.1.1) 80 | em-websocket (>= 0.2.0) 81 | middleman-core (>= 3.0.2) 82 | multi_json (~> 1.0) 83 | rack-livereload 84 | middleman-sprockets (3.4.1) 85 | middleman-core (>= 3.3) 86 | sprockets (~> 2.12.1) 87 | sprockets-helpers (~> 1.1.0) 88 | sprockets-sass (~> 1.3.0) 89 | mimemagic (0.4.3) 90 | nokogiri (~> 1) 91 | rake 92 | mini_mime (1.1.2) 93 | mini_portile2 (2.8.6) 94 | minitest (5.15.0) 95 | multi_json (1.15.0) 96 | multi_xml (0.6.0) 97 | nokogiri (1.16.5) 98 | mini_portile2 (~> 2.8.2) 99 | racc (~> 1.4) 100 | padrino-helpers (0.12.4) 101 | i18n (~> 0.6, >= 0.6.7) 102 | padrino-support (= 0.12.4) 103 | tilt (~> 1.4.1) 104 | padrino-support (0.12.4) 105 | activesupport (>= 3.1) 106 | racc (1.7.3) 107 | rack (1.6.13) 108 | rack-livereload (0.3.15) 109 | rack 110 | rack-test (0.6.3) 111 | rack (>= 1.0) 112 | rake (12.3.3) 113 | rb-fsevent (0.9.4) 114 | rb-inotify (0.9.5) 115 | ffi (>= 0.5.0) 116 | sass (3.4.10) 117 | sprockets (2.12.5) 118 | hike (~> 1.2) 119 | multi_json (~> 1.0) 120 | rack (~> 1.0) 121 | tilt (~> 1.1, != 1.3.0) 122 | sprockets-helpers (1.1.0) 123 | sprockets (~> 2.0) 124 | sprockets-sass (1.3.1) 125 | sprockets (~> 2.0) 126 | tilt (~> 1.1) 127 | temple (0.8.2) 128 | thor (0.19.1) 129 | thread_safe (0.3.6) 130 | tilt (1.4.1) 131 | timers (4.0.1) 132 | hitimes 133 | tzinfo (1.2.10) 134 | thread_safe (~> 0.1) 135 | uber (0.0.12) 136 | uglifier (2.7.2) 137 | execjs (>= 0.3.0) 138 | json (>= 1.8.0) 139 | 140 | PLATFORMS 141 | ruby 142 | 143 | DEPENDENCIES 144 | doc_raptor (~> 0.3) 145 | middleman (~> 3.3.7) 146 | middleman-livereload (~> 3.1.0) 147 | mimemagic (~> 0.2) 148 | nokogiri (~> 1.16) 149 | rake 150 | 151 | BUNDLED WITH 152 | 1.10.1 153 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RailsGirls Workbook ![Travis CI](https://travis-ci.org/railsgirls/workbook.svg?branch=master) 2 | 3 | These are the sources for the RailsGirls Workbook. It is build using HTML and CSS with the intention to make it easier to collaboratively edit its contents. 4 | 5 | ## Downloads 6 | 7 | * [Download finished PDF releases of the Workbook](https://github.com/railsgirls/workbook/releases) 8 | * [Download the development PDF version of the Workbook](https://s3.eu-central-1.amazonaws.com/railsgirls-workbook/workbook.pdf) 9 | 10 | ## How to contribute 11 | 12 | ### Small contributions 13 | 14 | The simplest way to contribute small changes to the content of the workbook is to use [GitHub's file editing feature](https://help.github.com/articles/editing-files-in-another-user-s-repository/). Just open the [`index.html.erb`](https://github.com/railsgirls/workbook/blob/master/source/index.html.erb) file and start editing by clicking the pen icon. After you're done editing, commit your changes and create a new pull request. 15 | 16 | 17 | ### Advanced contributions 18 | 19 | For larger changes, such as changes to the styling, it's recommended to fork and check out the repository. You must have [Ruby](http://ruby-lang.org) and [Git](http://git-scm.com) installed. Start by [forking the workbook repository](https://help.github.com/articles/fork-a-repo/) and [cloning your fork](https://help.github.com/articles/cloning-a-repository/) using this command in your Terminal: 20 | 21 | ```shell 22 | git clone https://github.com//workbook 23 | ``` 24 | 25 | Afterwards, you can switch into the new directory and run the setup command, to install the necessary dependencies. 26 | 27 | ```shell 28 | cd workbook 29 | rake setup 30 | ``` 31 | 32 | Open the directory in your favorite editor and start changing the contents of the `source` directory. To preview your changes run `rake preview` and point your browser to [http://localhost:4567/](http://localhost:4567/). After you've made some changes, simply reload the page to see the updated preview. For your convenience you may also install the [LiveReload browser extension](http://livereload.com/extensions/), which will automatically reload the page after you save a file. 33 | 34 | *Please bear in mind that this is only a simulation of what the finished PDF will look like. There might be slight differences between the preview and the generated PDF*. 35 | 36 | When you're done editing, commit your changes, push them to GitHub and [create a new pull request](https://help.github.com/articles/creating-a-pull-request/). 37 | 38 | 39 | ## How this works under the hood 40 | 41 | The project is using [Middleman](http://middlemanapp.com) to generate the workbook's HTML source. The generated HTML is sent to [DocRaptor](http://docraptor.com) and transformed into a PDF. The process is automated using [Travis CI](http://travis-ci.org/railsgirls/workbook) which will push the generated PDF to [Amazon S3](http://aws.amazon.com/s3/). 42 | 43 | ## Todos 44 | 45 | * Create basic CSS framework to style pages 46 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | 3 | namespace :build do 4 | task :compile do 5 | sh 'bundle exec middleman build' 6 | end 7 | 8 | task html: [:compile] do 9 | require 'nokogiri' 10 | require 'mimemagic' 11 | 12 | file = File.read('build/index.html') 13 | 14 | document = Nokogiri::HTML(file) 15 | 16 | # Check for the correct number of pages 17 | number_of_pages = document.css('.page').count 18 | if (number_of_pages % 4) > 0 19 | puts "Number of pages must be a multiple of 4 for printing, but is #{number_of_pages}!" 20 | exit 1 21 | end 22 | 23 | # Embed stylesheets 24 | document.css('link[rel=stylesheet]').each do |link| 25 | style = Nokogiri::XML::Node.new('style', document) 26 | style.content = File.read("build/#{link['href']}") 27 | link.replace(style) 28 | end 29 | 30 | # Embed images 31 | document.css('img').each do |image| 32 | path = "build/#{image['src']}" 33 | 34 | content = File.read(path) 35 | content_type = MimeMagic.by_path(path) 36 | 37 | data = [content].flatten.pack('m').gsub("\n","") 38 | 39 | image['src'] = "data:#{content_type};base64,#{data}" 40 | end 41 | 42 | File.open('build/index.html', 'w') do |file| 43 | file.write(document.to_html) 44 | end 45 | 46 | puts "Successfully generated the HTML!" 47 | end 48 | 49 | task pdf: [:html] do 50 | require 'doc_raptor' 51 | 52 | DocRaptor.api_key(ENV['DOCRAPTOR_API_KEY']) 53 | 54 | options = { 55 | document_content: File.read('build/index.html'), 56 | name: 'workbook.pdf', 57 | document_type: 'pdf', 58 | test: ENV['TRAVIS_TAG'] == '', 59 | prince_options: { 60 | } 61 | } 62 | 63 | DocRaptor.create(options) do |pdf, response| 64 | if response.success? 65 | filename = (ENV['TRAVIS_BRANCH'] && ENV['TRAVIS_BRANCH'] != 'master') ? "workbook-#{ENV['TRAVIS_COMMIT']}.pdf" : 'workbook.pdf' 66 | File.open("build/#{filename}", 'w+b') { |file| file.write(pdf.read) } 67 | 68 | puts "Successfully generated the PDF (#{filename})!" 69 | 70 | if ENV['TRAVIS'] 71 | puts "After this build finished, the PDF will be available at" 72 | puts "https://s3.eu-central-1.amazonaws.com/railsgirls-workbook/#{filename}" 73 | end 74 | 75 | exit 0 76 | else 77 | puts "Failed to generate PDF: " 78 | response['errors']['error'].each do |error| 79 | puts " * #{error}" 80 | end 81 | exit 1 82 | end 83 | end 84 | end 85 | end 86 | 87 | task :preview do 88 | sh 'bundle exec middleman server' 89 | end 90 | 91 | task :setup do 92 | sh 'gem install bundler' 93 | sh 'bundle' 94 | end 95 | 96 | task default: 'build:pdf' -------------------------------------------------------------------------------- /config.rb: -------------------------------------------------------------------------------- 1 | set :css_dir, 'stylesheets' 2 | set :js_dir, 'javascripts' 3 | set :images_dir, 'images' 4 | 5 | configure :development do 6 | activate :livereload 7 | end 8 | -------------------------------------------------------------------------------- /misc/rg-workbook-interactive.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/railsgirls/workbook/a5ad4703c490c805b7a7f52d897fe01f89b94a1b/misc/rg-workbook-interactive.pdf -------------------------------------------------------------------------------- /source/images/bentobox.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | bentobox 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /source/images/flask.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | flask 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /source/images/heart.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | heart 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /source/images/ruby.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ruby 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /source/index.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Rails Girls Workbook 5 | 6 | 7 | 8 |
9 |
10 | + = 11 |
12 | 13 |
14 |

Rails Girls

15 | Your cookbook to the world
16 | of web development. 17 |
18 | 19 |

railsgirls.com

20 |
21 | 22 |
23 | 24 |
25 |

This book belongs to

26 | 27 |
28 | 29 |
30 |

Get excited and make things

31 |

Software changes cultures. We believe that in a world where everything will involve the Internet, we need to get the girls involved too.

32 | 33 |

Web applications are modern craftsmanship. Build tomorrow's products. Learn to solve problems. Wonder how things work.

34 | 35 |

We can give the ingredients, but you make the recipes.

36 |
37 | 38 |
39 |

Knowing How

40 |
41 |

“I’ve long argued that UI design, programming, and product strategy should be learned apprentice-style with your hands and through experience, not through school and pedagogy. When I go to conferences about design I see a lot of declarative knowledge. Knowledge of. The latest CSS rules. The new JavaScript syntax. Ten ways to make users happy (supposedly) or whatever else.

42 | 43 |

What I don’t see are procedures—somebody standing up there with a pen or a text editor and making things happen and showing how it’s done. That’s what I want to see and that’s what I think our industry needs more of.”

44 | 45 | - Ryan Singer, 37 Signals 46 |
47 | 48 |

Further Reading

49 | 85 |
86 | 87 |
88 |

Don't daydream. Just design.

89 |

Draw. Sketch. Wireframe. Mockup.

90 |

Plans and ideas are nothing compared to something you can see, touch, hear or smell.

91 |

Most applications are just screens with boxes, anyone can draw them. If you can’t, you need to think about the idea more.

92 |

Drawing captures your idea into something concrete and real.

93 |
94 | 95 |
96 |

Checklist for your web project

97 | 98 | 129 |
130 | 131 |
132 |

Lunch box your web app.

133 |

The Bentobox is our conceptual model for understanding web applications and their components.

134 | 135 |

The Japanese lunchbox model aims to have a balanced mix of things. Much like web apps, the “Ekiben“ looks for content which is arranged in the most efficient, graceful manner. The bento is presented in a simple, beautiful, balanced way. Nothing lacking. Nothing superfluous. Not decorated, but wonderfully designed.

136 |
137 | 138 |
139 | 140 | 141 |
142 |

Bentobox

143 | 144 | 145 | 146 | 147 | 148 | 149 |
150 | 151 |
152 |

Storage

153 |

154 | Backend.
155 | How the application stores data. 156 |

157 |
158 | 159 |
160 |

Logic

161 |

162 | Backend.
163 | How the application works. 164 |

165 |
166 | 167 |
168 |

Infrastructure

169 |

170 | Backend.
171 | How the application runs. 172 |

173 |
174 | 175 |
176 |

Style and structure

177 |

178 | Frontend.
179 | How the application looks. 180 |

181 |
182 |
183 | 184 |
185 |

Cheatsheet for your app

186 | 216 |
217 | 218 |
219 |

Getting further

220 | 257 |
258 | 259 |
260 |

Get going with something small.

261 |

Once you’ve gotten the first bite of coding web apps, try out the following.

262 |

The idea is not to start building the next Facebook. Try creating something simple, yet interesting, in just a couple of days.

263 |

Focus on the one thing you want to achieve - this is what applications anyways should be about.

264 |
265 | 266 |
267 |

Start with simple mockups of your idea

268 | 273 | 274 |

Design

275 | 280 | 281 | 282 |

Marketing Magic

283 | 288 | 289 |

Customer service & feedback

290 | 295 | 296 |

Developer communities

297 | 302 | 303 |

Social

304 | 308 |
309 | 310 |
311 |

Make it real.
Make it happen.

312 | 313 |

Coding is only part of the fun. As soon as you have an application up and running, you should start thinking about your users and how to keep your app running.

314 | 315 |
316 |
317 |
Draw here your first e-mail newsletter template to your users.
318 |
319 |
320 | 321 |
322 | 323 |
324 |

That's all!

325 | 326 | 330 | 331 |

railsgirls.com

332 |
333 | 334 | -------------------------------------------------------------------------------- /source/stylesheets/_reset.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * html5doctor.com Reset Stylesheet v1.6.1 (http://html5doctor.com/html-5-reset-stylesheet/) 3 | * Richard Clark (http://richclarkdesign.com) 4 | * http://cssreset.com 5 | */ 6 | html, body, div, span, object, iframe, 7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 8 | abbr, address, cite, code, 9 | del, dfn, em, img, ins, kbd, q, samp, 10 | small, strong, sub, sup, var, 11 | b, i, 12 | dl, dt, dd, ol, ul, li, 13 | fieldset, form, label, legend, 14 | table, caption, tbody, tfoot, thead, tr, th, td, 15 | article, aside, canvas, details, figcaption, figure, 16 | footer, header, hgroup, menu, nav, section, summary, 17 | time, mark, audio, video { 18 | margin:0; 19 | padding:0; 20 | border:0; 21 | outline:0; 22 | font-size:100%; 23 | vertical-align:baseline; 24 | background:transparent; 25 | } 26 | body { 27 | line-height:1; 28 | } 29 | article,aside,details,figcaption,figure, 30 | footer,header,hgroup,menu,nav,section { 31 | display:block; 32 | } 33 | nav ul { 34 | list-style:none; 35 | } 36 | blockquote, q { 37 | quotes:none; 38 | } 39 | blockquote:before, blockquote:after, 40 | q:before, q:after { 41 | content:''; 42 | content:none; 43 | } 44 | a { 45 | margin:0; 46 | padding:0; 47 | font-size:100%; 48 | vertical-align:baseline; 49 | background:transparent; 50 | } 51 | /* change colours to suit your needs */ 52 | ins { 53 | background-color:#ff9; 54 | color:#000; 55 | text-decoration:none; 56 | } 57 | /* change colours to suit your needs */ 58 | mark { 59 | background-color:#ff9; 60 | color:#000; 61 | font-style:italic; 62 | font-weight:bold; 63 | } 64 | del { 65 | text-decoration: line-through; 66 | } 67 | abbr[title], dfn[title] { 68 | border-bottom:1px dotted; 69 | cursor:help; 70 | } 71 | table { 72 | border-collapse:collapse; 73 | border-spacing:0; 74 | } 75 | /* change border colour to suit your needs */ 76 | hr { 77 | display:block; 78 | height:1px; 79 | border:0; 80 | border-top:1px solid #cccccc; 81 | margin:1em 0; 82 | padding:0; 83 | } 84 | input, select { 85 | vertical-align:middle; 86 | } -------------------------------------------------------------------------------- /source/stylesheets/workbook.scss: -------------------------------------------------------------------------------- 1 | @import 'reset'; 2 | 3 | $red: #bb2830; 4 | $black: #1a1919; 5 | $grey: #e4e4e3; 6 | 7 | $page-width: 148mm; 8 | $page-height: 210mm; 9 | 10 | @page { 11 | margin: 0; 12 | size: A5; 13 | } 14 | 15 | @page cover { 16 | background: $red; 17 | } 18 | 19 | @page empty { 20 | background: $grey; 21 | } 22 | 23 | @page horizontal { 24 | size: A5 landscape; 25 | } 26 | 27 | body, html { 28 | width: 100%; 29 | height: 100%; 30 | } 31 | 32 | body { 33 | text-rendering: geometricPrecision; 34 | padding: 0; 35 | margin: 0; 36 | 37 | font-family: 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif; 38 | } 39 | 40 | input, textarea { 41 | background: $grey; 42 | display: block; 43 | width: 100%; 44 | border: none; 45 | font-size: 20pt; 46 | } 47 | 48 | textarea { 49 | height: 3em; 50 | } 51 | 52 | blockquote { 53 | margin: 0 0 1em 0; 54 | font-style: italic; 55 | } 56 | 57 | h1, h2 { 58 | color: $red; 59 | margin-bottom: .5em 60 | } 61 | 62 | h1 { 63 | font-size: 30pt; 64 | line-height: 1.1em; 65 | } 66 | 67 | h2 { 68 | font-size: 14pt; 69 | } 70 | 71 | p { 72 | margin: 1em 0; 73 | } 74 | 75 | ul { 76 | list-style: none; 77 | padding: 0; 78 | margin: 0; 79 | 80 | > li { 81 | margin: 0.4em 0; 82 | } 83 | 84 | li li { 85 | margin: 0.2em 0; 86 | } 87 | } 88 | 89 | code { 90 | display: inline-block; 91 | border: solid 1px grey; 92 | padding: 0.1em 0.4em; 93 | margin: 0.1em 0; 94 | border-radius: 0.2em; 95 | vertical-align: baseline; 96 | } 97 | 98 | a { 99 | color: inherit; 100 | text-decoration: none; 101 | } 102 | 103 | .frame { 104 | border: 3pt $grey solid; 105 | width: 100%; 106 | height: 10em; 107 | } 108 | 109 | figcaption { 110 | font-size: 10pt; 111 | font-style: italic; 112 | } 113 | 114 | .page { 115 | box-sizing: border-box; 116 | page-break-before: always; 117 | 118 | position: relative; 119 | 120 | width: 100%; 121 | height: 100%; 122 | color: $black; 123 | background: white; 124 | font-size: 10pt; 125 | line-height: 1.3; 126 | 127 | &:nth-child(odd) { 128 | padding: 2cm 2cm 2cm 3cm; 129 | } 130 | 131 | &:nth-child(even) { 132 | padding: 2cm 3cm 2cm 2cm; 133 | } 134 | 135 | &.horizontal { 136 | page: horizontal; 137 | 138 | &:nth-child(odd) { 139 | padding: 3cm 2cm 2cm 2cm; 140 | } 141 | 142 | &:nth-child(even) { 143 | padding: 2cm 2cm 3cm 2cm; 144 | } 145 | } 146 | 147 | img { 148 | max-width: 100%; 149 | max-height: 100%; 150 | } 151 | 152 | &.front, &.back { 153 | background: $red; 154 | color: white; 155 | text-align: center; 156 | padding: 0; 157 | } 158 | 159 | &.front { 160 | page: cover; 161 | font-weight: bold; 162 | font-size: 12pt; 163 | 164 | .formula { 165 | font-size: 50pt; 166 | padding-top: 5cm; 167 | } 168 | 169 | img { 170 | width: 2cm; 171 | vertical-align: middle; 172 | 173 | &.flask { 174 | margin-top: -0.5cm; 175 | } 176 | } 177 | 178 | header { 179 | font-size: 25pt; 180 | margin-bottom: 2cm; 181 | } 182 | 183 | h1 { 184 | font-size: 70pt; 185 | margin: 1.5cm 0 0 0; 186 | color: inherit; 187 | } 188 | } 189 | 190 | &.back { 191 | page: cover; 192 | font-weight: bold; 193 | font-size: 12pt; 194 | 195 | h1 { 196 | font-size: 50pt; 197 | padding-top: 8cm; 198 | margin-top: 0; 199 | color: inherit; 200 | } 201 | 202 | .copyright { 203 | font-weight: normal; 204 | } 205 | } 206 | 207 | &.empty { 208 | page: empty; 209 | background: $grey; 210 | } 211 | 212 | &.motivational { 213 | font-size: 16pt; 214 | padding-top: 5cm; 215 | 216 | * { 217 | position: relative; 218 | bottom: 0cm; 219 | } 220 | } 221 | } 222 | 223 | #bentobox { 224 | position: relative; 225 | 226 | h2 { 227 | margin: 0 0 .3em 0; 228 | } 229 | 230 | p { 231 | margin: 0; 232 | } 233 | 234 | input { 235 | width: 3cm; 236 | background: white; 237 | } 238 | 239 | label { 240 | font-weight: bold; 241 | } 242 | 243 | .meta { 244 | position: absolute; 245 | top: 2cm; 246 | left: 2cm; 247 | 248 | * { 249 | display: inline-block; 250 | margin: 0; 251 | vertical-align: baseline; 252 | } 253 | 254 | h1 { 255 | margin: 0 1em 0 0; 256 | } 257 | } 258 | 259 | img { 260 | margin-top: 1cm; 261 | } 262 | 263 | .compartment { 264 | position: absolute; 265 | z-index: 10; 266 | overflow: hidden; 267 | 268 | &.top-left { 269 | top: 4.75cm; 270 | left: 2.8cm; 271 | width: 5cm; 272 | height: 3.5cm; 273 | } 274 | 275 | &.top-right { 276 | top: 4.75cm; 277 | left: 8.75cm; 278 | width: 9.2cm; 279 | height: 1.8cm; 280 | } 281 | 282 | &.bottom-left { 283 | top: 9.3cm; 284 | left: 2.8cm; 285 | width: 5cm; 286 | height: 2.2cm; 287 | } 288 | 289 | &.bottom-right { 290 | top: 7.3cm; 291 | left: 8.75cm; 292 | width: 9.2cm; 293 | height: 1.8cm; 294 | } 295 | } 296 | } 297 | 298 | @media screen { 299 | body { 300 | background: #ddd; 301 | } 302 | 303 | .page { 304 | box-shadow: 0 0 0.5cm #999; 305 | width: $page-width; 306 | height: $page-height; 307 | margin: 1cm auto; 308 | 309 | &.horizontal { 310 | height: $page-width; 311 | width: $page-height; 312 | } 313 | } 314 | } --------------------------------------------------------------------------------