├── .gitignore ├── Gemfile ├── templates ├── static │ ├── brick.png │ └── css │ │ ├── doc.css │ │ └── github.css ├── _footer.html └── _header.html ├── components ├── frame │ ├── skin │ │ ├── frameThumb.css │ │ ├── frameStandard.css │ │ ├── frameSmall.css │ │ └── frameStacked.css │ └── frames.css ├── badge │ ├── badge.css │ └── skin │ │ └── badgeSkins.css ├── toggle │ ├── toggle.css │ └── toggle.js ├── index.md ├── typography │ └── typography.css ├── background │ └── backgrounds.css └── button │ ├── buttons.css │ └── skin │ └── buttonSkins.css ├── README.md ├── config.yml └── LICENSE.txt /.gitignore: -------------------------------------------------------------------------------- 1 | /docs 2 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "http://rubygems.org" 2 | gem "compass" 3 | gem "hologram" 4 | -------------------------------------------------------------------------------- /templates/static/brick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trulia/hologram-example/HEAD/templates/static/brick.png -------------------------------------------------------------------------------- /components/frame/skin/frameThumb.css: -------------------------------------------------------------------------------- 1 | /*doc 2 | --- 3 | parent: frame 4 | title: Thumbnail Frame 5 | name: frameThumb 6 | --- 7 | 8 | ```html_example 9 |
10 | 11 |
12 | ``` 13 | */ 14 | 15 | .frameThumb { 16 | padding: 2px; 17 | } 18 | -------------------------------------------------------------------------------- /components/frame/skin/frameStandard.css: -------------------------------------------------------------------------------- 1 | /*doc 2 | --- 3 | parent: frame 4 | title: Standard Frame 5 | name: frameStandard 6 | --- 7 | 8 | ```html_example 9 |
10 | 11 |
12 | ``` 13 | */ 14 | 15 | .frameStandard { 16 | padding: 8px; 17 | } 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Example hologram style guide 2 | 3 | This is an example project that uses 4 | [hologram](http://trulia.github.io/hologram) to build [this style 5 | guide](http://trulia.github.io/hologram-example). In order to build the 6 | style guide yourself, run the following: 7 | 8 | gem install hologram 9 | cd hologram-example 10 | hologram config.yml 11 | 12 | **Nota Bene:** This example uses jQuery loaded from a CDN to build a simple menu navigation. You'll need to run a local server to see this menu in action. 13 | 14 | # License 15 | 16 | Like hologram itself, this example is licensed under the MIT license. 17 | -------------------------------------------------------------------------------- /components/badge/badge.css: -------------------------------------------------------------------------------- 1 | /*doc 2 | --- 3 | title: Badges 4 | name: badge 5 | category: Components 6 | --- 7 | 8 | Badges are a way to display a small amount of text or an image within a 9 | nicely formatted box. 10 | 11 | */ 12 | .badgeStandard, .badgePrimary, .badgeSecondary { 13 | -webkit-border-radius: 3px; 14 | -moz-border-radius: 3px; 15 | -ms-border-radius: 3px; 16 | -o-border-radius: 3px; 17 | border-radius: 3px; 18 | font-size: 12px; 19 | font-size: 0.75rem; 20 | padding: 0.35714em 0.42857em 0.21429em; 21 | display: inline-block; 22 | color: white; 23 | line-height: 1; 24 | text-transform: uppercase; 25 | } 26 | -------------------------------------------------------------------------------- /components/frame/skin/frameSmall.css: -------------------------------------------------------------------------------- 1 | /*doc 2 | --- 3 | parent: frame 4 | title: Small Frame 5 | name: frameSmall 6 | --- 7 | 8 | A small frame using the `.polaroid` class to include some text along with the image. Note the use of the inline style to set the width. 9 | This is one of the only places where that is acceptable... 10 | 11 | ```html_example 12 |
13 | 14 |
15 |

Here's a little text below the image

16 |
17 |
18 | ``` 19 | */ 20 | 21 | .frameSmall { 22 | padding: 6px; 23 | } 24 | -------------------------------------------------------------------------------- /templates/_footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /components/toggle/toggle.css: -------------------------------------------------------------------------------- 1 | .toggle { 2 | position: relative; 3 | cursor: pointer; 4 | } 5 | 6 | .toggleArrow .before, .toggleArrow:before { 7 | content: "\25BA"; 8 | display: inline-block; 9 | width: 1.3em; 10 | font-size: .9em; 11 | text-align: center; 12 | } 13 | 14 | .toggleArrowActive:before { 15 | content: "\25BC"; 16 | } 17 | 18 | /* IE7 */ 19 | .toggleArrow:hover .before { 20 | text-decoration: none; 21 | } 22 | 23 | .toggleArrow .active, .toggleActive .inactive { 24 | display: none; 25 | } 26 | 27 | .toggleActive .active { 28 | display: inline-block; 29 | } 30 | 31 | .toggleActive .inactive { 32 | display: none; 33 | } 34 | -------------------------------------------------------------------------------- /components/badge/skin/badgeSkins.css: -------------------------------------------------------------------------------- 1 | /*doc 2 | --- 3 | title: Badge Colors 4 | parent: badge 5 | name: badgeSkins 6 | category: Components 7 | --- 8 | 9 | Class | Description 10 | -------------- | ----------------- 11 | badgeStandard | This is a basic badge 12 | badgePrimary | This is a badge with the trulia orange used on CTAs 13 | badgeSecondary | This is a badge with the alternate CTA color (Trulia green) 14 | badgeTertiary | This is a badge for a warning or something negative 15 | 16 | 17 | ```html_example 18 | Sold 19 | For Sale 20 | For Rent 21 | ``` 22 | 23 | */ 24 | .badgeStandard { 25 | background-color: #999999; 26 | } 27 | 28 | .badgePrimary { 29 | background-color: #ff5c00; 30 | } 31 | 32 | .badgeSecondary { 33 | background-color: #5eab1f; 34 | } 35 | -------------------------------------------------------------------------------- /components/frame/frames.css: -------------------------------------------------------------------------------- 1 | /*doc 2 | --- 3 | title: Frames 4 | name: frame 5 | category: Components 6 | --- 7 | 8 | A frame is a simple border around some content, usually an image but 9 | other content can be used as well. The different skin classes generally 10 | change the intensity and padding size of the frame. 11 | 12 | */ 13 | 14 | 15 | .frameThumb, .frameSmall, .frameStandard, .frameStacked { 16 | display: inline-block; 17 | *display: inline; 18 | *zoom: 1; 19 | *border: 1px solid #e9e9e9; 20 | -webkit-box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2); 21 | -moz-box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2); 22 | box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2); 23 | } 24 | .frameThumb img, .frameSmall img, .frameStandard img, .frameStacked img { 25 | display: block; 26 | } 27 | .frameThumb .polaroid, .frameSmall .polaroid, .frameStandard .polaroid, .frameStacked .polaroid { 28 | margin-top: 5px; 29 | } 30 | -------------------------------------------------------------------------------- /config.yml: -------------------------------------------------------------------------------- 1 | # Hologram config 2 | 3 | # The directory containing the source files to parse 4 | source: ./components 5 | 6 | # The directory that hologram will build to 7 | destination: ./docs 8 | 9 | # The assets needed to build the docs (includes header.html, footer.html, etc) 10 | documentation_assets: ./templates 11 | 12 | # This is a custom markdown renderer (see Redcarpet documentation for 13 | # how to do this) 14 | # custom_markdown: trulia_markdown_renderer.rb 15 | 16 | # Any other asset folders that need to be copied to the destination folder 17 | # This where you should include your full stylesheets, component javascript, 18 | # libraries and any other dependencies your style guide will have 19 | dependencies: 20 | - ./build 21 | 22 | # To additionally output navigation for top level sections, set the value to 23 | # 'section'. To output navigation for sub-sections, 24 | # set the value to `all` 25 | nav_level: all 26 | -------------------------------------------------------------------------------- /components/index.md: -------------------------------------------------------------------------------- 1 | #Welcome 2 | 3 | This style guide is an example of what 4 | [hologram](http://trulia.github.io/hologram) can help you build and 5 | maintain. 6 | 7 | The goal of hologram is to make it easy to document your CSS and to 8 | display the code examples to use that CSS. Hologram has no 9 | opinions about how you should actually organize/style your style guide. 10 | You could do everything as a single file with no header/footer and it 11 | would work just fine. Or, you could break it up into an individual file 12 | for each component. Top navigation, left navigation, no 13 | navigation....that's up to you. Build it however you'd like. 14 | 15 | 16 | We've borrowed some of [Trulia](http://trulia.com)'s own CSS library to 17 | demonstrate how hologram can be used. If you want more details about 18 | hologram see the [git repository](http://github.com/trulia/hologram). 19 | 20 | 21 | This is a work in progress, please consider contributing to 22 | [hologram](http://github.com/trulia/hologram). 23 | 24 | -------------------------------------------------------------------------------- /components/typography/typography.css: -------------------------------------------------------------------------------- 1 | /*doc 2 | --- 3 | title: Typography 4 | name: typography 5 | category: Base CSS 6 | --- 7 | 8 | These are the heading sizes that you can use site wide. 9 | 10 | ```html_example_table 11 |

h1 36px

12 | 13 |

h2 25px

14 | 15 |

h3 20px

16 | 17 |

h4 18px

18 | 19 |
h5 16px
20 | 21 |

This is an example of our base font style 16px. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco 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.

22 | ``` 23 | 24 | */ 25 | 26 | h1{ 27 | font-size: 36px; 28 | } 29 | 30 | h2{ 31 | font-size: 25px; 32 | } 33 | 34 | h3{ 35 | font-size: 20px; 36 | } 37 | 38 | h4{ 39 | font-size: 18px; 40 | } 41 | 42 | h5{ 43 | font-size: 16px; 44 | } 45 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Trulia, Inc. 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /components/frame/skin/frameStacked.css: -------------------------------------------------------------------------------- 1 | /*doc 2 | --- 3 | parent: frame 4 | title: Stacked frame with rotations 5 | name: frameStacked 6 | --- 7 | 8 | ```html_example 9 |
10 | 11 |
12 | ``` 13 | */ 14 | 15 | .frameStacked { 16 | padding: 8px; 17 | position: relative; 18 | background-color: #fff; 19 | } 20 | 21 | .frameStacked:before, .frameStacked:after { 22 | -webkit-box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2); 23 | -moz-box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2); 24 | box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2); 25 | width: 100%; 26 | height: 100%; 27 | position: absolute; 28 | z-index: -999; 29 | content: ""; 30 | background-color: #f9f9f9; 31 | } 32 | 33 | .frameStacked:before { 34 | left: 5px; 35 | top: 0px; 36 | -webkit-transform: rotate(1deg); 37 | -moz-transform: rotate(1deg); 38 | -ms-transform: rotate(1deg); 39 | -o-transform: rotate(1deg); 40 | transform: rotate(1deg); 41 | } 42 | 43 | .frameStacked:after { 44 | right: 5px; 45 | top: 0px; 46 | -webkit-transform: rotate(-1deg); 47 | -moz-transform: rotate(-1deg); 48 | -ms-transform: rotate(-1deg); 49 | -o-transform: rotate(-1deg); 50 | transform: rotate(-1deg); 51 | } 52 | -------------------------------------------------------------------------------- /components/background/backgrounds.css: -------------------------------------------------------------------------------- 1 | /*doc 2 | --- 3 | title: Background Colors 4 | name: background 5 | category: Base CSS 6 | --- 7 | 8 | We have a few background colors that can be used in various contexts. 9 | These are not for use as the entire page background but instead for 10 | specific components and modules on the page. 11 | 12 |
13 |
14 |
15 | backgroundLowlight 16 |
17 |
18 |
19 | backgroundHighlight 20 |
21 |
22 |
23 | backgroundBasic 24 |
25 |
26 |
27 | backgroundInverse 28 |
29 |
30 | */ 31 | 32 | .backgroundBasic { 33 | background-color: white; 34 | } 35 | 36 | .backgroundLowlight { 37 | background-color: #f9f9f9; 38 | } 39 | 40 | .backgroundHighlight { 41 | background-color: #5eab1f; 42 | } 43 | 44 | .backgroundInverse { 45 | background-color: #222222; 46 | } 47 | -------------------------------------------------------------------------------- /templates/_header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | My Style Guide <%= title %> 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 47 | 48 |
49 |
50 |
51 | 52 |
53 |
54 |
55 | 60 |
61 |
62 |
63 | 64 |
65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /components/button/buttons.css: -------------------------------------------------------------------------------- 1 | /*doc 2 | --- 3 | title: Buttons 4 | name: button 5 | category: Base CSS 6 | --- 7 | 8 | Button styles can be applied to any element. Typically you'll want to 9 | use either a ` 13 | Don't click 14 | ``` 15 | 16 | If your button is actually a link to another page, please use the 17 | `` element, while if your button performs an action, such as submitting 18 | a form or triggering some javascript event, then use a ` | `btn btnDefault btnLrg` 30 | | `btn btnDefault` 31 | | `btn btnDefault btnSml` 32 | | `btn btnDefault btnFullWidth` 33 | 34 | */ 35 | 36 | button { 37 | background: none; 38 | border: 0; 39 | } 40 | 41 | /* Base button */ 42 | .btn { 43 | padding: .5em 1em; 44 | margin: 0; 45 | display: inline-block; 46 | font-weight: normal; 47 | line-height: normal; 48 | font-size: 14px; 49 | font-size: 0.875rem; 50 | text-decoration: none; 51 | cursor: pointer; 52 | border: 0; 53 | background: none; 54 | text-align: center; 55 | border: 1px solid #cccccc; 56 | -webkit-border-radius: 4px; 57 | -moz-border-radius: 4px; 58 | -ms-border-radius: 4px; 59 | -o-border-radius: 4px; 60 | border-radius: 4px; 61 | } 62 | 63 | /* Button sizes */ 64 | .btnSml { 65 | font-size: 10px; 66 | font-size: 0.625rem; 67 | -webkit-border-radius: 4px; 68 | -moz-border-radius: 4px; 69 | -ms-border-radius: 4px; 70 | -o-border-radius: 4px; 71 | border-radius: 4px; 72 | } 73 | 74 | .btnLrg { 75 | font-size: 16px; 76 | font-size: 1rem; 77 | line-height: 1.6; 78 | -webkit-border-radius: 4px; 79 | -moz-border-radius: 4px; 80 | -ms-border-radius: 4px; 81 | -o-border-radius: 4px; 82 | border-radius: 4px; 83 | } 84 | 85 | .btnFullWidth { 86 | width: 100%; 87 | } 88 | -------------------------------------------------------------------------------- /templates/static/css/doc.css: -------------------------------------------------------------------------------- 1 | .container { 2 | max-width: 1128px; 3 | width: auto; 4 | margin: 0 auto; 5 | } 6 | 7 | .content { 8 | margin-top: 5px; 9 | } 10 | 11 | 12 | .main > h1 { 13 | margin-top: 30px; 14 | } 15 | 16 | .main > h1:first-child { 17 | margin-top: 0; 18 | } 19 | 20 | footer { 21 | margin-top: 20px; 22 | text-align: center; 23 | } 24 | 25 | 26 | .componentMenu { 27 | max-height: 535px; 28 | width: 175px; 29 | overflow-y: auto; 30 | } 31 | 32 | blockquote:before { 33 | content: "Design Note:"; 34 | font-weight: bold; 35 | } 36 | 37 | blockquote { 38 | border: 1px solid #eee; 39 | border-radius: 4px; 40 | font-family: "Comic Sans MS"; 41 | font-size:16px; 42 | margin: 10px 0; 43 | padding: 5px; 44 | 45 | } 46 | 47 | 48 | code { 49 | padding: 2px 4px; 50 | color: #d14; 51 | white-space: nowrap; 52 | background-color: #f9f9f9; 53 | border: 1px solid #ccc; 54 | border-radius: 4px; 55 | } 56 | 57 | div.codeExample, div.jsExample { 58 | border: 1px solid #ccc; 59 | border-radius: 4px; 60 | margin: 10px 0; 61 | } 62 | 63 | div.jsExample { 64 | border-top: 0px; 65 | } 66 | 67 | div.codeExample:before, div.jsExample:before { 68 | font-family: "OpenSans", sans-serif; 69 | color: #222; 70 | border: 1px solid #ccc; 71 | border-radius: 4px; 72 | border-bottom-left-radius: 0; 73 | border-top-right-radius: 0; 74 | position: relative; 75 | padding: 2px; 76 | display: block; 77 | } 78 | 79 | div.codeExample:before { 80 | content: "Example"; 81 | background-color: #f9f9f9; 82 | width: 60px; 83 | top: -1px; 84 | left: -1px; 85 | } 86 | 87 | div.jsExample:before { 88 | content: "JS Example"; 89 | background-color: #fff; 90 | width: 80px; 91 | top: -11px; 92 | left: -11px; 93 | } 94 | 95 | div.codeBlock, div.exampleOutput { 96 | padding: 10px; 97 | } 98 | 99 | div.codeBlock { 100 | background-color: #f9f9f9; 101 | border-top: 1px solid #ccc; 102 | border-bottom-left-radius: 4px; 103 | border-bottom-right-radius: 4px; 104 | } 105 | 106 | table div.codeBlock { 107 | background-color: transparent; 108 | border-top: none; 109 | border-radius: 0; 110 | } 111 | 112 | .docSwatch { 113 | min-height: 218.21px; 114 | border: 1px solid #ccc; 115 | padding: 10px 0 0 10px; 116 | font-size: 12px; 117 | margin-bottom: 5px; 118 | } 119 | 120 | .codeExample .line > div:after { 121 | content: attr(class); 122 | display: block; 123 | min-height: 40px; 124 | line-height: 40px; 125 | background-color: #EEE; 126 | text-align: center; 127 | border-radius: 3px; 128 | font-size: 12px; 129 | } 130 | 131 | table, table tr, table td, table th { 132 | padding: 7px; 133 | border: 1px solid #ccc; 134 | } 135 | 136 | table th { 137 | font-weight: bold; 138 | } 139 | -------------------------------------------------------------------------------- /templates/static/css/github.css: -------------------------------------------------------------------------------- 1 | hll { background-color: #ffffcc } 2 | .c { color: #999988; font-style: italic } /* Comment */ 3 | .err { color: #a61717; background-color: #e3d2d2 } /* Error */ 4 | .k { color: #000000; font-weight: bold } /* Keyword */ 5 | .o { color: #000000; font-weight: bold } /* Operator */ 6 | .cm { color: #999988; font-style: italic } /* Comment.Multiline */ 7 | .cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */ 8 | .c1 { color: #999988; font-style: italic } /* Comment.Single */ 9 | .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ 10 | .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ 11 | .ge { color: #000000; font-style: italic } /* Generic.Emph */ 12 | .gr { color: #aa0000 } /* Generic.Error */ 13 | .gh { color: #999999 } /* Generic.Heading */ 14 | .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ 15 | .go { color: #888888 } /* Generic.Output */ 16 | .gp { color: #555555 } /* Generic.Prompt */ 17 | .gs { font-weight: bold } /* Generic.Strong */ 18 | .gu { color: #aaaaaa } /* Generic.Subheading */ 19 | .gt { color: #aa0000 } /* Generic.Traceback */ 20 | .kc { color: #000000; font-weight: bold } /* Keyword.Constant */ 21 | .kd { color: #000000; font-weight: bold } /* Keyword.Declaration */ 22 | .kn { color: #000000; font-weight: bold } /* Keyword.Namespace */ 23 | .kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */ 24 | .kr { color: #000000; font-weight: bold } /* Keyword.Reserved */ 25 | .kt { color: #445588; font-weight: bold } /* Keyword.Type */ 26 | .m { color: #009999 } /* Literal.Number */ 27 | .s { color: #d01040 } /* Literal.String */ 28 | .na { color: #008080 } /* Name.Attribute */ 29 | .nb { color: #0086B3 } /* Name.Builtin */ 30 | .nc { color: #445588; font-weight: bold } /* Name.Class */ 31 | .no { color: #008080 } /* Name.Constant */ 32 | .nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */ 33 | .ni { color: #800080 } /* Name.Entity */ 34 | .ne { color: #990000; font-weight: bold } /* Name.Exception */ 35 | .nf { color: #990000; font-weight: bold } /* Name.Function */ 36 | .nl { color: #990000; font-weight: bold } /* Name.Label */ 37 | .nn { color: #555555 } /* Name.Namespace */ 38 | .nt { color: #000080 } /* Name.Tag */ 39 | .nv { color: #008080 } /* Name.Variable */ 40 | .ow { color: #000000; font-weight: bold } /* Operator.Word */ 41 | .w { color: #bbbbbb } /* Text.Whitespace */ 42 | .mf { color: #009999 } /* Literal.Number.Float */ 43 | .mh { color: #009999 } /* Literal.Number.Hex */ 44 | .mi { color: #009999 } /* Literal.Number.Integer */ 45 | .mo { color: #009999 } /* Literal.Number.Oct */ 46 | .sb { color: #d01040 } /* Literal.String.Backtick */ 47 | .sc { color: #d01040 } /* Literal.String.Char */ 48 | .sd { color: #d01040 } /* Literal.String.Doc */ 49 | .s2 { color: #d01040 } /* Literal.String.Double */ 50 | .se { color: #d01040 } /* Literal.String.Escape */ 51 | .sh { color: #d01040 } /* Literal.String.Heredoc */ 52 | .si { color: #d01040 } /* Literal.String.Interpol */ 53 | .sx { color: #d01040 } /* Literal.String.Other */ 54 | .sr { color: #009926 } /* Literal.String.Regex */ 55 | .s1 { color: #d01040 } /* Literal.String.Single */ 56 | .ss { color: #990073 } /* Literal.String.Symbol */ 57 | .bp { color: #999999 } /* Name.Builtin.Pseudo */ 58 | .vc { color: #008080 } /* Name.Variable.Class */ 59 | .vg { color: #008080 } /* Name.Variable.Global */ 60 | .vi { color: #008080 } /* Name.Variable.Instance */ 61 | .il { color: #009999 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /components/button/skin/buttonSkins.css: -------------------------------------------------------------------------------- 1 | /*doc 2 | --- 3 | parent: button 4 | name: buttonSkins 5 | title: Button Styles 6 | --- 7 | 8 | Button | Class | Description 9 | ------------------------------------------------- | ----------------- | ----------- 10 | | `btn btnDefault` | This is what buttons look like, this is the go to button style. 11 | | `btn btnPrimary` | Use this button as the primary call to action 12 | | `btn btnDanger` | This button is for delete actions, these actions should also have a confirmation dialog 13 | | `btn btnDisabled` | I'm afraid I can't let you do that, yet. 14 | 15 | */ 16 | 17 | .btnDefault, 18 | a.btnDefault { 19 | border: 1px #d7d7d7 solid; 20 | background: #f3f3f3; 21 | color: #222222; 22 | text-shadow: 0 1px 0 white; 23 | -webkit-box-shadow: 0 1px 0px #cccccc; 24 | -moz-box-shadow: 0 1px 0px #cccccc; 25 | box-shadow: 0 1px 0px #cccccc; 26 | } 27 | 28 | .btnDefault:hover, 29 | .btnDefault:focus { 30 | background: #f6f6f6; 31 | } 32 | 33 | .btnDefault:active { 34 | position: relative; 35 | top: 1px; 36 | -webkit-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05); 37 | -moz-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05); 38 | box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05); 39 | } 40 | 41 | .btnPrimary, 42 | a.btnPrimary, .btnDanger, 43 | a.btnDanger { 44 | color: white; 45 | text-shadow: 0 0 0; 46 | } 47 | 48 | .btnPrimary, 49 | a.btnPrimary { 50 | border: 1px #d14b00 solid; 51 | background: #ff5c00; 52 | -webkit-box-shadow: 0 1px 0px #d35500; 53 | -moz-box-shadow: 0 1px 0px #d35500; 54 | box-shadow: 0 1px 0px #d35500; 55 | } 56 | 57 | .btnPrimary:hover, 58 | .btnPrimary:focus { 59 | background: #ff660f; 60 | } 61 | 62 | .btnPrimary:active { 63 | position: relative; 64 | top: 1px; 65 | -webkit-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05); 66 | -moz-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05); 67 | box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05); 68 | } 69 | 70 | .btnDanger, 71 | a.btnDanger { 72 | border: 1px #a21a10 solid; 73 | background: #cc2114; 74 | -webkit-box-shadow: 0 1px 0px #d35500; 75 | -moz-box-shadow: 0 1px 0px #d35500; 76 | box-shadow: 0 1px 0px #d35500; 77 | } 78 | 79 | .btnDanger:hover, 80 | .btnDanger:focus { 81 | background: #da2315; 82 | } 83 | 84 | .btnDanger:active { 85 | position: relative; 86 | top: 1px; 87 | -webkit-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05); 88 | -moz-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05); 89 | box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05); 90 | } 91 | 92 | .btn[disabled], 93 | .btn[disabled]:hover, 94 | .btn[disabled]:focus 95 | .btn[disabled]:active, 96 | .btnDisabled, 97 | a.btnDisabled, 98 | .btnDisabled:hover, 99 | .btnDisabled:focus, 100 | .btnDisabled:active { 101 | border: 0px; 102 | background: #cccccc; 103 | color: #999999; 104 | text-shadow: 0 0 0; 105 | cursor: default; 106 | } 107 | 108 | .btn[disabled]:active, 109 | .btnDisabled:active { 110 | position: static; 111 | color: #999999; 112 | box-shadow: none; 113 | } 114 | -------------------------------------------------------------------------------- /components/toggle/toggle.js: -------------------------------------------------------------------------------- 1 | /*doc 2 | --- 3 | title: Toggle 4 | name: toggle 5 | category: Javascript 6 | --- 7 | 8 | Toggles should be used display show/hide comment. For example, showing/hiding a additional information on the search results page. 9 | You can set the default as either active or inactive by specifying the class on the span to be either `toggleActive` or `toggleInactive`, 10 | and setting (or not setting) the class `hideVisually` on the container that you are toggling. 11 | 12 | Here's how you kick this off: 13 | 14 | ```html_example 15 | More Options 16 |
Yo, I got some content to show you. Lorem ipsum occaecat eiusmod Ut et sit sint quis qui labore in exercitation 17 | esse. Lorem ipsum in aliquip esse anim aliquip ullamco sit dolor in deserunt eu labore. Lorem ipsum magna 18 | officia in laborum fugiat proident cupidatat in ex aliquip velit officia nulla aliquip ut. Lorem ipsum 19 | nostrud ad Ut nulla velit qui esse tempor Excepteur consectetur pariatur enim. 20 |
21 | ``` 22 | 23 | ```js_example 24 | $(document).ready(function () { 25 | $('.toggle').truliaToggle(); 26 | }); 27 | ``` 28 | 29 | Below are some methods you can also call on the toggle component and events you can listen to: 30 | 31 | method | description 32 | ----------------|------------------------ 33 | `toggle` | Toggle the tooltip. Optional boolean argument to force active. Example: `$('.toggle').truliaToggle('toggle', true)` 34 | **events** | 35 | `toggle` | Listen to this event to perform an action when the toggle has changed state `$('.toggle').on('toggle', function (e, active) { if (active) console.log('I\m Active!') })` 36 | 37 | */ 38 | 39 | ;(function ($) { 40 | var setArrow = function($el) { 41 | if ($el.hasClass('toggleArrow')) 42 | { 43 | $el.toggleClass('toggleArrowActive'); 44 | } 45 | }; 46 | 47 | var methods = { 48 | init: function () { 49 | return this.each(function () { 50 | if ($(this).data('toggleInit') !== true) { 51 | //Prevent multiple initializations 52 | $(this).data('toggleInit', true); 53 | 54 | $(this).click(function (event) { 55 | event.preventDefault(); 56 | methods.toggle.apply(this); 57 | }); 58 | } 59 | }); 60 | }, 61 | 62 | toggle: function (activate) { 63 | return $(this).each(function () { 64 | var $toggle, 65 | data, 66 | container, 67 | toggled = false; 68 | 69 | $toggle = $(this); 70 | 71 | container = $($toggle.attr('href')); 72 | 73 | if (activate || activate === false) 74 | { 75 | // forced state toggle 76 | toggled = container.hasClass('hideVisually') === activate; 77 | $toggle.toggleClass('toggleActive', activate); 78 | container.toggleClass('hideVisually', !activate); 79 | } 80 | else 81 | { 82 | // toggle 83 | toggled = true; 84 | $toggle.toggleClass('toggleActive'); 85 | container.toggleClass('hideVisually'); 86 | } 87 | 88 | if (toggled) 89 | { 90 | // update arrow status 91 | setArrow($toggle); 92 | 93 | // update the label 94 | data = $toggle.data(); 95 | if (data.toggleText) { 96 | var show = data.toggleText; 97 | 98 | //store our current text 99 | $toggle.data('toggleText', $toggle.text()); 100 | 101 | //switch to our toggle text 102 | $toggle.text(show); 103 | } 104 | 105 | $toggle.trigger('toggle', [(activate || $toggle.hasClass('toggleActive'))]); 106 | } 107 | }); 108 | } 109 | 110 | }; 111 | 112 | $.fn.truliaToggle = function (method) { 113 | if (typeof method === 'string' && typeof methods[method] === 'function') 114 | { 115 | return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); 116 | } 117 | else if (typeof method === 'object' || !method) 118 | { 119 | return methods.init.apply(this, arguments); 120 | } 121 | else 122 | { 123 | $.error('Method ' + method + ' does not exist on jQuery.truliaToggle'); 124 | } 125 | }; 126 | 127 | }(jQuery)); 128 | --------------------------------------------------------------------------------