{{title}}
4 | Show Code 5 | 6 |Description
22 |-
23 | {% for description in descriptions %}
24 |
{{description}}
25 | {% endfor %}
26 |
├── .bowerrc ├── .gitignore ├── README.md ├── bower.json ├── config.rb ├── css ├── style-guide-overrides.css ├── style-guide-source.css └── style-guide.css ├── js └── style-guide.js ├── page-style-guide-source.twig ├── page-style-guide.twig ├── sass ├── components │ ├── _style-guide-imports.scss │ └── _style-guide-variables.scss ├── style-guide-overrides.scss ├── style-guide-source.scss └── style-guide.scss └── templates ├── components ├── style-mod.twig └── style-nav.twig └── style-guide.twig /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components", 3 | "analytics": false 4 | } 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bower_components 2 | *.sublime* -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Upstatement Style Guide 2 | #### Template for Twig/Timber 3 | 4 | ### What Is This? 5 | A style guide starter theme that helps display typography, objects, and other design patterns. It’s templated using Twig & Timber for easy inclusion in our WordPress projects. 6 | 7 | The Style Guide is designed for easy use by our clients. It lets the designer **name components** and **write notes** about when to use them. It gives the client **code snips** that make it easy to copy, paste, and replicate our work. 8 | 9 | Check out this [live example](http://harvardlawreview.org/style-guide/) of the Style Guide in action for [The Harvard Law Review](http://harvardlawreview.org/style-guide/). 10 | 11 | ### How Does it Work? 12 | 13 | This package ships with some standard patterns (buttons, text styles, section headers, etc.) to help you get started. But nothing is set in stone. Delete anything you don’t want, replace anything the needs changing, and add custom components for your project. 14 | 15 | ### Installation 16 | 17 | 1. **Get the Style Guide** Download the zip file for this repo 18 | 2. **Add To Your Project** Place the folder in top level of your theme, this will be something like `wp-content/themes/[your theme name]` 19 | 3. **Install Dependencies** Navigate to the folder in terminal. Run `bower install` 20 | 4. **Process CSS** Navigate to the folder in terminal. Run `compass watch` 21 | 5. **Render the Style Guide** WordPress needs to know the Style Guide exists in order to render it. You’ll need to point WP to the two twig templates that show the Style Guide, `page-style-guide.twig` and `page-style-guide-source.twig`. These can be found at the top level of this repository. To do this, you have to take two steps. 22 | 23 | * First, **move the `page-style-guide.twig` and `page-style-guide-source.twig` files** to a directory where WordPress will find the `page-` prefix and render pages. This is commonly a folder named `views` or `templates` and probably contains several other pages with the same prefix. 24 | 25 | * Second, **create the pages in the WordPress Pages menu**. The pages should be named Style Guide and Style Guide Source. It’s important that their permalinks exactly match the name of the files between the `page-` prefix and `.twig` suffix. Here’s what it should look like … 26 | 27 | _Style Guide_ 28 |  29 | 30 | _Style Guide Source_ 31 |  32 | 33 | 34 | ### How To Use 35 | 36 | After you’ve installed and confirmed that WordPress is rendering the Style Guide, you’ll want to customize it. Here’s how. 37 | 38 | #### Naming 39 | First, you’ll want to personalize your new Style Guide with the project name. Do this via the `client` variable on line 3 of `style-guide.twig`. 40 | 41 | ```twig 42 | {% set client = ‘Your Client Name’ %} 43 | ``` 44 | 45 | You’ll also want to set a relative path so all the base style guide components (CSS, JS, etc.) will link correctly. You can do this all from the `path` variable on line 4 of `style-guide.twig` 46 | 47 | ```twig 48 | {% set path = '/wp-content/themes/your_theme’ %} 49 | ``` 50 | 51 | #### Add Custom Code 52 | Add the appropriate Fonts, CSS, JS, etc. for your project. You’ll do this in the file named `page-style-guide-source.twig`. 53 | 54 | Use the `header_scripts` and `footer_scripts` blocks to add your custom elements and have them load at the top or bottom of the page, respectively. 55 | 56 | ```twig 57 | {% block header_scripts %} 58 | {# Your Fonts, CSS, JS, etc. go here #} 59 | {% endblock header_scripts %} 60 | 61 | {% block footer_scripts %} 62 | {# Your Fonts, CSS, JS, etc. go here #} 63 | {% endblock footer_scripts %} 64 | ``` 65 | 66 | #### Add Your Elements 67 | You’ll want to augment the Style Guide with your own HTML components — typography, teases, buttons, etc. Do this in file named `page-style-guide-source.twig`. 68 | 69 | **Basic Style Example** 70 | The template accepts raw HTML as well as [Twig includes](http://twig.sensiolabs.org/doc/tags/include.html). In the most basic template, you can simply name your component and add the appropriate HTML. 71 | 72 | ```twig 73 | {# 74 | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 75 | Headlines 76 | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 77 | #} 78 | {% embed style_mod 79 | with { title:'Headlines' } %} 80 | 81 | {% block markup %} 82 |
Assume that no search for this weapon was underway; our best guess is that even Sherlock Holmes never would have found it in the absence of the confession.
135 |Dec 31, 2013
221 | {% endblock markup %} 222 | 223 | {% endembed %} 224 | 225 | 226 | {# 227 | ~~~~~~~~~~~~~~~~~~ 228 | Article Text 229 | ~~~~~~~~~~~~~~~~~~ 230 | #} 231 | {% embed style_mod 232 | with { title:'Article Text' } %} 233 | 234 | {% block markup %} 235 |Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. This is a link in article text. Ut enim ad minim veniam, quis nostrud exercitation ullamco.
237 |This is article text. Laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
238 |This is a block quote. Laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
239 |This is article text. Laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
240 |Professor Waldron wishes that I had said more about how to achieve the changes that we both seem to favor. I too wish that I had said more. I wish that I had more to say.
259 |I hope it is not churlish to point out that the explanation of how to get from here to there is also underdeveloped in Waldrons’ own work about judicial review.
261 |In any event, I can say at least this much: The United States Supreme Court is not about to announce that henceforth it will disobey constitutional commands, and Congress is not about to enact legislation formally disavowing the Constitution.
263 |Moreover, here as elsewhere, unilateral disarmament is a bad idea. It makes no sense for one side to forego constitutional argument while the other uses it to its advantage.
265 |If there is to be change, then, it must first be on the cultural level, and cultural change occurs one conversation at a time. If there are to be conversations, though, the issue must first be salient, and right now it is not.
267 |To claim that my book, read by a tiny number of people, the vast majority of whom disagree with it, will make the issue salient would border on clinical narcissism. Putting the issue on the table requires action by culturally significant figures.
269 |Regular List
287 |Numbered List
293 |List Inside List
299 |327 |335 |“Perhaps that change will never come. Still, even if bold disarmament proves impossible, we might negotiate a less ambitious mutual arms reduction treaty.”
328 |“We might at least agree to stop pretending that italic constitutional text unambiguously and finally resolves the disputes between us.”
329 |330 |
334 |- List Link
331 |- List Bold
332 |- List Italic
333 |
353 | Assume that no search for this weapon was underway; our best guess is that even Sherlock Holmes never would have found it in the absence of the confession. 354 |
355 |Strong is used to indicate strong importance
375 |The i element really shouldn't be used but WordPress employs it and most normal users do, too.
376 |The b element is stylistically different text from normal text, without any special importance
377 |The em element is text that is set off from the normal text
378 |The u element is text with an unarticulated, though explicitly rendered, non-textual annotation
379 |This text has a strikethrough
Superscript®
381 |Subscript for things like H2O
382 |This small text is small for for fine print, etc.
383 |Keybord input: Cmd
384 |This is a citation
385 |The dfn element indicates a definition.
386 |This is what a table embedded in article text looks like.
404 | 405 |# | 409 |First Name | 410 |Last Name | 411 |Team | 412 |
---|---|---|---|
1 | 417 |Jennifer | 418 |Heath | 419 |HLR | 420 |
2 | 423 |Barack | 424 |Obama | 425 |Potus | 426 |
3 | 429 |Tito | 430 |Bottitta | 431 |Upstatement | 432 |
Supporting text for headline. What happens in the supporting text contains a link?
496 |Supporting text for headline. What happens in the supporting text contains a link?
500 |Supporting text for headline. What happens in the supporting text contains a link?I ask you again. What would happen if the supporting text contained a link? Would it be styled properly?
503 |# | 833 |First Name | 834 |Last Name | 835 |Team | 836 |
---|---|---|---|
1 | 841 |Jennifer | 842 |Heath | 843 |HLR | 844 |
2 | 847 |Barack | 848 |Obama | 849 |Potus | 850 |
3 | 853 |Tito | 854 |Bottitta | 855 |Upstatement | 856 |
# | 878 |First Name | 879 |Last Name | 880 |Team | 881 |
---|---|---|---|
1 | 886 |Jennifer | 887 |Heath | 888 |HLR | 889 |
2 | 892 |Barack | 893 |Obama | 894 |Potus | 895 |
3 | 898 |Tito | 899 |Bottitta | 900 |Upstatement | 901 |
{{description}}