concen 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +0 -3
- data/Gemfile.lock +0 -9
- data/LICENSE +1 -1
- data/README.md +23 -1
- data/app/assets/stylesheets/concen/application.css.sass +14 -16
- data/app/assets/stylesheets/concen/compass/_css3.scss +17 -0
- data/app/assets/stylesheets/concen/compass/_layout.scss +3 -0
- data/app/assets/stylesheets/concen/compass/_reset-legacy.scss +3 -0
- data/app/assets/stylesheets/concen/compass/_reset.scss +3 -0
- data/app/assets/stylesheets/concen/compass/_support.scss +36 -0
- data/app/assets/stylesheets/concen/compass/_typography.scss +4 -0
- data/app/assets/stylesheets/concen/compass/_utilities.scss +9 -0
- data/app/assets/stylesheets/concen/compass/css3/_appearance.scss +13 -0
- data/app/assets/stylesheets/concen/compass/css3/_background-clip.scss +43 -0
- data/app/assets/stylesheets/concen/compass/css3/_background-origin.scss +42 -0
- data/app/assets/stylesheets/concen/compass/css3/_background-size.scss +26 -0
- data/app/assets/stylesheets/concen/compass/css3/_border-radius.scss +135 -0
- data/app/assets/stylesheets/concen/compass/css3/_box-shadow.scss +93 -0
- data/app/assets/stylesheets/concen/compass/css3/_box-sizing.scss +13 -0
- data/app/assets/stylesheets/concen/compass/css3/_box.scss +111 -0
- data/app/assets/stylesheets/concen/compass/css3/_columns.scss +60 -0
- data/app/assets/stylesheets/concen/compass/css3/_font-face.scss +63 -0
- data/app/assets/stylesheets/concen/compass/css3/_gradient.scss +99 -0
- data/app/assets/stylesheets/concen/compass/css3/_images.scss +132 -0
- data/app/assets/stylesheets/concen/compass/css3/_inline-block.scss +16 -0
- data/app/assets/stylesheets/concen/compass/css3/_opacity.scss +19 -0
- data/app/assets/stylesheets/concen/compass/css3/_pie.scss +73 -0
- data/app/assets/stylesheets/concen/compass/css3/_shared.scss +38 -0
- data/app/assets/stylesheets/concen/compass/css3/_text-shadow.scss +62 -0
- data/app/assets/stylesheets/concen/compass/css3/_transform-legacy.scss +87 -0
- data/app/assets/stylesheets/concen/compass/css3/_transform.scss +598 -0
- data/app/assets/stylesheets/concen/compass/css3/_transition.scss +119 -0
- data/app/assets/stylesheets/concen/compass/layout/_grid-background.scss +178 -0
- data/app/assets/stylesheets/concen/compass/layout/_sticky-footer.scss +23 -0
- data/app/assets/stylesheets/concen/compass/layout/_stretching.scss +24 -0
- data/app/assets/stylesheets/concen/compass/reset/_utilities-legacy.scss +135 -0
- data/app/assets/stylesheets/concen/compass/reset/_utilities.scss +140 -0
- data/app/assets/stylesheets/concen/compass/typography/_links.scss +3 -0
- data/app/assets/stylesheets/concen/compass/typography/_lists.scss +4 -0
- data/app/assets/stylesheets/concen/compass/typography/_text.scss +4 -0
- data/app/assets/stylesheets/concen/compass/typography/_vertical_rhythm.scss +193 -0
- data/app/assets/stylesheets/concen/compass/typography/links/_hover-link.scss +5 -0
- data/app/assets/stylesheets/concen/compass/typography/links/_link-colors.scss +28 -0
- data/app/assets/stylesheets/concen/compass/typography/links/_unstyled-link.scss +7 -0
- data/app/assets/stylesheets/concen/compass/typography/lists/_bullets.scss +34 -0
- data/app/assets/stylesheets/concen/compass/typography/lists/_horizontal-list.scss +61 -0
- data/app/assets/stylesheets/concen/compass/typography/lists/_inline-block-list.scss +47 -0
- data/app/assets/stylesheets/concen/compass/typography/lists/_inline-list.scss +44 -0
- data/app/assets/stylesheets/concen/compass/typography/text/_ellipsis.scss +25 -0
- data/app/assets/stylesheets/concen/compass/typography/text/_force-wrap.scss +12 -0
- data/app/assets/stylesheets/concen/compass/typography/text/_nowrap.scss +2 -0
- data/app/assets/stylesheets/concen/compass/typography/text/_replacement.scss +34 -0
- data/app/assets/stylesheets/concen/compass/utilities/_color.scss +1 -0
- data/app/assets/stylesheets/concen/compass/utilities/_general.scss +6 -0
- data/app/assets/stylesheets/concen/compass/utilities/_links.scss +5 -0
- data/app/assets/stylesheets/concen/compass/utilities/_lists.scss +6 -0
- data/app/assets/stylesheets/concen/compass/utilities/_print.scss +17 -0
- data/app/assets/stylesheets/concen/compass/utilities/_sprites.scss +1 -0
- data/app/assets/stylesheets/concen/compass/utilities/_tables.scss +3 -0
- data/app/assets/stylesheets/concen/compass/utilities/_text.scss +5 -0
- data/app/assets/stylesheets/concen/compass/utilities/color/_contrast.scss +28 -0
- data/app/assets/stylesheets/concen/compass/utilities/general/_clearfix.scss +44 -0
- data/app/assets/stylesheets/concen/compass/utilities/general/_float.scss +30 -0
- data/app/assets/stylesheets/concen/compass/utilities/general/_hacks.scss +46 -0
- data/app/assets/stylesheets/concen/compass/utilities/general/_min.scss +16 -0
- data/app/assets/stylesheets/concen/compass/utilities/general/_reset.scss +2 -0
- data/app/assets/stylesheets/concen/compass/utilities/general/_tabs.scss +1 -0
- data/app/assets/stylesheets/concen/compass/utilities/general/_tag-cloud.scss +18 -0
- data/app/assets/stylesheets/concen/compass/utilities/links/_hover-link.scss +3 -0
- data/app/assets/stylesheets/concen/compass/utilities/links/_link-colors.scss +3 -0
- data/app/assets/stylesheets/concen/compass/utilities/links/_unstyled-link.scss +3 -0
- data/app/assets/stylesheets/concen/compass/utilities/lists/_bullets.scss +3 -0
- data/app/assets/stylesheets/concen/compass/utilities/lists/_horizontal-list.scss +3 -0
- data/app/assets/stylesheets/concen/compass/utilities/lists/_inline-block-list.scss +3 -0
- data/app/assets/stylesheets/concen/compass/utilities/lists/_inline-list.scss +3 -0
- data/app/assets/stylesheets/concen/compass/utilities/sprites/_base.scss +66 -0
- data/app/assets/stylesheets/concen/compass/utilities/sprites/_sprite-img.scss +56 -0
- data/app/assets/stylesheets/concen/compass/utilities/tables/_alternating-rows-and-columns.scss +20 -0
- data/app/assets/stylesheets/concen/compass/utilities/tables/_borders.scss +33 -0
- data/app/assets/stylesheets/concen/compass/utilities/tables/_scaffolding.scss +9 -0
- data/app/assets/stylesheets/concen/compass/utilities/text/_ellipsis.scss +3 -0
- data/app/assets/stylesheets/concen/compass/utilities/text/_nowrap.scss +3 -0
- data/app/assets/stylesheets/concen/compass/utilities/text/_replacement.scss +3 -0
- data/app/assets/stylesheets/concen/partials/_base.sass +4 -4
- data/app/assets/stylesheets/concen/partials/_variables.sass +5 -5
- data/app/helpers/concen/application_helper.rb +0 -6
- data/app/models/concen/page.rb +12 -3
- data/app/views/concen/grid_files/_form.html.erb +23 -0
- data/app/views/concen/grid_files/edit.html.erb +10 -0
- data/app/views/concen/pages/_file_list.erb +11 -0
- data/app/views/concen/pages/_files.erb +32 -0
- data/app/views/concen/pages/_form.html.erb +26 -0
- data/app/views/concen/pages/_nested_list.html.erb +22 -0
- data/app/views/concen/pages/edit.html.erb +19 -0
- data/app/views/concen/pages/index.html.erb +12 -0
- data/app/views/concen/pages/new.html.erb +10 -0
- data/app/views/concen/performances/_runtimes.html.erb +8 -0
- data/app/views/concen/performances/show.html.erb +40 -0
- data/app/views/concen/sessions/new.html.erb +17 -0
- data/app/views/concen/statuses/_server.html.erb +34 -0
- data/app/views/concen/statuses/show.html.erb +27 -0
- data/app/views/concen/traffics/_pages.html.erb +8 -0
- data/app/views/concen/traffics/_referrals.html.erb +12 -0
- data/app/views/concen/traffics/show.html.erb +40 -0
- data/app/views/concen/users/_form.html.erb +42 -0
- data/app/views/concen/users/{_password_reset.html.haml → _password_reset.html.erb} +0 -0
- data/app/views/concen/users/_settings.html.erb +23 -0
- data/app/views/concen/users/edit.html.erb +12 -0
- data/app/views/concen/users/index.html.erb +40 -0
- data/app/views/concen/users/new.html.erb +6 -0
- data/app/views/concen/users/new_invite.html.erb +24 -0
- data/app/views/concen/users/new_reset_password.html.erb +24 -0
- data/app/views/layouts/concen/{_additional_header_links.haml → _additional_header_links.html.erb} +0 -0
- data/app/views/layouts/concen/_header.html.erb +24 -0
- data/app/views/layouts/concen/{maintenance.html.haml → _iphone.html.erb} +0 -0
- data/app/views/layouts/concen/application.html.erb +42 -0
- data/app/views/layouts/concen/maintenance.html.erb +0 -0
- data/concen.gemspec +0 -2
- data/lib/concen/engine.rb +0 -1
- data/lib/concen/version.rb +1 -1
- data/test/support/raw_text/smartypants.html +1 -1
- data/test/support/raw_text/smartypants.txt +1 -1
- metadata +130 -74
- data/app/views/concen/grid_files/_form.html.haml +0 -15
- data/app/views/concen/grid_files/edit.html.haml +0 -7
- data/app/views/concen/pages/_file_list.haml +0 -7
- data/app/views/concen/pages/_files.haml +0 -24
- data/app/views/concen/pages/_form.html.haml +0 -17
- data/app/views/concen/pages/_nested_list.html.haml +0 -15
- data/app/views/concen/pages/edit.html.haml +0 -13
- data/app/views/concen/pages/index.html.haml +0 -12
- data/app/views/concen/pages/new.html.haml +0 -7
- data/app/views/concen/performances/_runtimes.html.haml +0 -5
- data/app/views/concen/performances/show.html.haml +0 -27
- data/app/views/concen/sessions/new.html.haml +0 -12
- data/app/views/concen/statuses/_server.html.haml +0 -19
- data/app/views/concen/statuses/show.html.haml +0 -18
- data/app/views/concen/traffics/_pages.html.haml +0 -5
- data/app/views/concen/traffics/_referrals.html.haml +0 -9
- data/app/views/concen/traffics/show.html.haml +0 -27
- data/app/views/concen/users/_form.html.haml +0 -29
- data/app/views/concen/users/_settings.html.haml +0 -15
- data/app/views/concen/users/edit.html.haml +0 -9
- data/app/views/concen/users/index.html.haml +0 -32
- data/app/views/concen/users/new.html.haml +0 -4
- data/app/views/concen/users/new_invite.html.haml +0 -15
- data/app/views/concen/users/new_reset_password.html.haml +0 -15
- data/app/views/layouts/concen/_header.html.haml +0 -18
- data/app/views/layouts/concen/_iphone.html.haml +0 -6
- data/app/views/layouts/concen/application.html.haml +0 -33
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// Based on [Eric Meyer's reset 2.0](http://meyerweb.com/eric/tools/css/reset/index.html)
|
|
2
|
+
// Global reset rules.
|
|
3
|
+
// For more specific resets, use the reset mixins provided below
|
|
4
|
+
@mixin global-reset {
|
|
5
|
+
html, body, div, span, applet, object, iframe,
|
|
6
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
7
|
+
a, abbr, acronym, address, big, cite, code,
|
|
8
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
9
|
+
small, strike, strong, sub, sup, tt, var,
|
|
10
|
+
b, u, i, center,
|
|
11
|
+
dl, dt, dd, ol, ul, li,
|
|
12
|
+
fieldset, form, label, legend,
|
|
13
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
14
|
+
article, aside, canvas, details, embed,
|
|
15
|
+
figure, figcaption, footer, header, hgroup,
|
|
16
|
+
menu, nav, output, ruby, section, summary,
|
|
17
|
+
time, mark, audio, video {
|
|
18
|
+
@include reset-box-model;
|
|
19
|
+
@include reset-font; }
|
|
20
|
+
body {
|
|
21
|
+
@include reset-body; }
|
|
22
|
+
ol, ul {
|
|
23
|
+
@include reset-list-style; }
|
|
24
|
+
table {
|
|
25
|
+
@include reset-table; }
|
|
26
|
+
caption, th, td {
|
|
27
|
+
@include reset-table-cell; }
|
|
28
|
+
q, blockquote {
|
|
29
|
+
@include reset-quotation; }
|
|
30
|
+
a img {
|
|
31
|
+
@include reset-image-anchor-border; }
|
|
32
|
+
@include reset-html5; }
|
|
33
|
+
|
|
34
|
+
// Reset all elements within some selector scope. To reset the selector itself,
|
|
35
|
+
// mixin the appropriate reset mixin for that element type as well. This could be
|
|
36
|
+
// useful if you want to style a part of your page in a dramatically different way.
|
|
37
|
+
@mixin nested-reset {
|
|
38
|
+
div, span, applet, object, iframe,
|
|
39
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
40
|
+
a, abbr, acronym, address, big, cite, code,
|
|
41
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
42
|
+
small, strike, strong, sub, sup, tt, var,
|
|
43
|
+
b, u, i, center,
|
|
44
|
+
dl, dt, dd, ol, ul, li,
|
|
45
|
+
fieldset, form, label, legend,
|
|
46
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
47
|
+
article, aside, canvas, details, embed,
|
|
48
|
+
figure, figcaption, footer, header, hgroup,
|
|
49
|
+
menu, nav, output, ruby, section, summary,
|
|
50
|
+
time, mark, audio, video {
|
|
51
|
+
@include reset-box-model;
|
|
52
|
+
@include reset-font; }
|
|
53
|
+
table {
|
|
54
|
+
@include reset-table; }
|
|
55
|
+
caption, th, td {
|
|
56
|
+
@include reset-table-cell; }
|
|
57
|
+
q, blockquote {
|
|
58
|
+
@include reset-quotation; }
|
|
59
|
+
a img {
|
|
60
|
+
@include reset-image-anchor-border; } }
|
|
61
|
+
|
|
62
|
+
// Reset the box model measurements.
|
|
63
|
+
@mixin reset-box-model {
|
|
64
|
+
margin: 0;
|
|
65
|
+
padding: 0;
|
|
66
|
+
border: 0; }
|
|
67
|
+
|
|
68
|
+
// Reset the font and vertical alignment.
|
|
69
|
+
@mixin reset-font {
|
|
70
|
+
font-size: 100%;
|
|
71
|
+
font: inherit;
|
|
72
|
+
vertical-align: baseline; }
|
|
73
|
+
|
|
74
|
+
// Resets the outline when focus.
|
|
75
|
+
// For accessibility you need to apply some styling in its place.
|
|
76
|
+
@mixin reset-focus {
|
|
77
|
+
outline: 0; }
|
|
78
|
+
|
|
79
|
+
// Reset a body element.
|
|
80
|
+
@mixin reset-body {
|
|
81
|
+
line-height: 1; }
|
|
82
|
+
|
|
83
|
+
// Reset the list style of an element.
|
|
84
|
+
@mixin reset-list-style {
|
|
85
|
+
list-style: none; }
|
|
86
|
+
|
|
87
|
+
// Reset a table
|
|
88
|
+
@mixin reset-table {
|
|
89
|
+
border-collapse: collapse;
|
|
90
|
+
border-spacing: 0; }
|
|
91
|
+
|
|
92
|
+
// Reset a table cell (`th`, `td`)
|
|
93
|
+
@mixin reset-table-cell {
|
|
94
|
+
text-align: left;
|
|
95
|
+
font-weight: normal;
|
|
96
|
+
vertical-align: middle; }
|
|
97
|
+
|
|
98
|
+
// Reset a quotation (`q`, `blockquote`)
|
|
99
|
+
@mixin reset-quotation {
|
|
100
|
+
quotes: none;
|
|
101
|
+
&:before, &:after {
|
|
102
|
+
content: "";
|
|
103
|
+
content: none; } }
|
|
104
|
+
|
|
105
|
+
// Resets the border.
|
|
106
|
+
@mixin reset-image-anchor-border {
|
|
107
|
+
border: none; }
|
|
108
|
+
|
|
109
|
+
// Unrecognized elements are displayed inline.
|
|
110
|
+
// This reset provides a basic reset for block html5 elements
|
|
111
|
+
// so they are rendered correctly in browsers that don't recognize them
|
|
112
|
+
// and reset in browsers that have default styles for them.
|
|
113
|
+
@mixin reset-html5 {
|
|
114
|
+
#{elements-of-type(html5-block)} {
|
|
115
|
+
display: block; } }
|
|
116
|
+
|
|
117
|
+
// Resets the display of inline and block elements to their default display
|
|
118
|
+
// according to their tag type. Elements that have a default display that varies across
|
|
119
|
+
// versions of html or browser are not handled here, but this covers the 90% use case.
|
|
120
|
+
// Usage Example:
|
|
121
|
+
//
|
|
122
|
+
// // Turn off the display for both of these classes
|
|
123
|
+
// .unregistered-only, .registered-only
|
|
124
|
+
// display: none
|
|
125
|
+
// // Now turn only one of them back on depending on some other context.
|
|
126
|
+
// body.registered
|
|
127
|
+
// +reset-display(".registered-only")
|
|
128
|
+
// body.unregistered
|
|
129
|
+
// +reset-display(".unregistered-only")
|
|
130
|
+
@mixin reset-display($selector: "", $important: false) {
|
|
131
|
+
#{append-selector(elements-of-type("inline"), $selector)} {
|
|
132
|
+
@if $important {
|
|
133
|
+
display: inline !important; }
|
|
134
|
+
@else {
|
|
135
|
+
display: inline; } }
|
|
136
|
+
#{append-selector(elements-of-type("block"), $selector)} {
|
|
137
|
+
@if $important {
|
|
138
|
+
display: block !important; }
|
|
139
|
+
@else {
|
|
140
|
+
display: block; } } }
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
// The base font size
|
|
2
|
+
$base-font-size: 16px !default;
|
|
3
|
+
|
|
4
|
+
// The base line height is the basic unit of line hightness.
|
|
5
|
+
$base-line-height: 24px !default;
|
|
6
|
+
|
|
7
|
+
// set the default border style for rhythm borders
|
|
8
|
+
$default-rhythm-border-style: solid !default;
|
|
9
|
+
|
|
10
|
+
// The IE font ratio is a fact of life. Deal with it.
|
|
11
|
+
$ie-font-ratio: 16px / 100%;
|
|
12
|
+
|
|
13
|
+
// Set to false if you want to use absolute pixes in sizing your typography.
|
|
14
|
+
$relative-font-sizing: true !default;
|
|
15
|
+
|
|
16
|
+
// Ensure there is at least this many pixels
|
|
17
|
+
// of vertical padding above and below the text.
|
|
18
|
+
$min-line-padding: 2px;
|
|
19
|
+
|
|
20
|
+
// $base-font-size but in your output unit of choice.
|
|
21
|
+
// Defaults to 1em when `$relative-font-sizing`
|
|
22
|
+
$font-unit: if($relative-font-sizing, 1em, $base-font-size) !default;
|
|
23
|
+
|
|
24
|
+
// The basic unit of font rhythm
|
|
25
|
+
$base-rhythm-unit: $base-line-height / $base-font-size * $font-unit;
|
|
26
|
+
|
|
27
|
+
// The leader is the amount of whitespace in a line.
|
|
28
|
+
// It might be useful in your calculations
|
|
29
|
+
$base-leader: ($base-line-height - $base-font-size) * $font-unit / $base-font-size;
|
|
30
|
+
|
|
31
|
+
// The half-leader is the amount of whitespace above and below a line.
|
|
32
|
+
// It might be useful in your calculations
|
|
33
|
+
$base-half-leader: $base-leader / 2;
|
|
34
|
+
|
|
35
|
+
// True if a number has a relative unit
|
|
36
|
+
@function relative-unit($number) {
|
|
37
|
+
@return unit($number) == "%" or unit($number) == "em" or unit($number) == "rem"
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// True if a number has an absolute unit
|
|
41
|
+
@function absolute-unit($number) {
|
|
42
|
+
@return not (relative-unit($number) or unitless($number));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@if $relative-font-sizing and not relative-unit($font-unit) {
|
|
46
|
+
@warn "$relative-font-sizing is true but $font-unit is set to #{$font-unit} which is not a relative unit.";
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Establishes a font baseline for the given font-size in pixels
|
|
50
|
+
@mixin establish-baseline($font-size: $base-font-size) {
|
|
51
|
+
body {
|
|
52
|
+
font-size: $font-size / $ie-font-ratio;
|
|
53
|
+
@include adjust-leading-to(1, if($relative-font-sizing, $font-size, $base-font-size));
|
|
54
|
+
}
|
|
55
|
+
html>body {
|
|
56
|
+
font-size: $font-size;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Show a background image that can be used to debug your alignments.
|
|
61
|
+
@mixin debug-vertical-alignment($img: 'underline.png') {
|
|
62
|
+
background: url($img);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Adjust a block to have a different font size and leading to maintain the rhythm.
|
|
66
|
+
// $lines is a number that is how many times the baseline rhythm this
|
|
67
|
+
// font size should use up. Does not have to be an integer, but it defaults
|
|
68
|
+
// to the smallest integer that is large enough to fit the font.
|
|
69
|
+
// Use $from_size to adjust from a non-base font-size.
|
|
70
|
+
@mixin adjust-font-size-to($to-size, $lines: lines-for-font-size($to-size), $from-size: $base-font-size) {
|
|
71
|
+
@if not $relative-font-sizing and $from-size != $base-font-size {
|
|
72
|
+
@warn "$relative-font-sizing is false but a relative font size was passed to adjust-font-size-to";
|
|
73
|
+
}
|
|
74
|
+
font-size: $font-unit * $to-size / $from-size;
|
|
75
|
+
@include adjust-leading-to($lines, if($relative-font-sizing, $to-size, $base-font-size));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@mixin adjust-leading-to($lines, $font-size: $base-font-size) {
|
|
79
|
+
@if not $relative-font-sizing and $font-size != $base-font-size {
|
|
80
|
+
@warn "$relative-font-sizing is false but a relative font size was passed to adjust-leading-to";
|
|
81
|
+
}
|
|
82
|
+
line-height: $font-unit * $lines * $base-line-height / $font-size;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Calculate rhythm units
|
|
86
|
+
@function rhythm(
|
|
87
|
+
$lines: 1,
|
|
88
|
+
$font-size: $base-font-size
|
|
89
|
+
) {
|
|
90
|
+
@if not $relative-font-sizing and $font-size != $base-font-size {
|
|
91
|
+
@warn "$relative-font-sizing is false but a relative font size was passed to the rhythm function";
|
|
92
|
+
}
|
|
93
|
+
$rhythm: $font-unit * $lines * $base-line-height / $font-size;
|
|
94
|
+
@return $rhythm;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@function lines-for-font-size($font-size) {
|
|
98
|
+
$lines: ceil($font-size / $base-line-height);
|
|
99
|
+
@if $lines * $base-line-height - $font-size < $min-line-padding * 2 {
|
|
100
|
+
$lines: $lines + 1;
|
|
101
|
+
}
|
|
102
|
+
@return $lines;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Apply leading whitespace
|
|
106
|
+
@mixin leader($lines: 1, $font-size: $base-font-size, $property: margin) {
|
|
107
|
+
$leader: rhythm($lines, $font-size);
|
|
108
|
+
@if unit($leader) == px {
|
|
109
|
+
$leader: floor($leader)
|
|
110
|
+
}
|
|
111
|
+
#{$property}-top: $leader;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Apply leading whitespace as padding
|
|
115
|
+
@mixin padding-leader($lines: 1, $font-size: $base-font-size) {
|
|
116
|
+
@include leader($lines, $font-size, padding);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Apply leading whitespace as margin
|
|
120
|
+
@mixin margin-leader($lines: 1, $font-size: $base-font-size) {
|
|
121
|
+
@include leader($lines, $font-size, margin);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Apply trailing whitespace
|
|
125
|
+
@mixin trailer($lines: 1, $font-size: $base-font-size, $property: margin) {
|
|
126
|
+
$leader: rhythm($lines, $font-size);
|
|
127
|
+
@if unit($leader) == px {
|
|
128
|
+
$leader: ceil($leader)
|
|
129
|
+
}
|
|
130
|
+
#{$property}-bottom: $leader;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Apply trailing whitespace as padding
|
|
134
|
+
@mixin padding-trailer($lines: 1, $font-size: $base-font-size) {
|
|
135
|
+
@include trailer($lines, $font-size, padding);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Apply trailing whitespace as margin
|
|
139
|
+
@mixin margin-trailer($lines: 1, $font-size: $base-font-size) {
|
|
140
|
+
@include trailer($lines, $font-size, margin);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Whitespace application shortcut
|
|
144
|
+
// Apply top margin/padding + bottom padding/margin
|
|
145
|
+
@mixin rhythm($leader: 0, $padding-leader: 0, $padding-trailer: 0, $trailer: 0, $font-size: $base-font-size) {
|
|
146
|
+
@include leader($leader, $font-size);
|
|
147
|
+
@include padding-leader($padding-leader, $font-size);
|
|
148
|
+
@include padding-trailer($padding-trailer, $font-size);
|
|
149
|
+
@include trailer($trailer, $font-size);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Apply a border width to any side without destroying the vertical rhythm
|
|
153
|
+
@mixin apply-side-rhythm-border($side, $width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) {
|
|
154
|
+
@if not $relative-font-sizing and $font-size != $base-font-size {
|
|
155
|
+
@warn "$relative-font-sizing is false but a relative font size was passed to apply-side-rhythm-border";
|
|
156
|
+
}
|
|
157
|
+
border-#{$side}: {
|
|
158
|
+
style: $border-style;
|
|
159
|
+
width: $font-unit * $width / $font-size;
|
|
160
|
+
};
|
|
161
|
+
padding-#{$side}: $font-unit / $font-size * ($lines * $base-line-height - $width);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Aplly rhythm borders equally to all sides
|
|
165
|
+
@mixin rhythm-borders($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) {
|
|
166
|
+
@if not $relative-font-sizing and $font-size != $base-font-size {
|
|
167
|
+
@warn "$relative-font-sizing is false but a relative font size was passed to rhythm-borders";
|
|
168
|
+
}
|
|
169
|
+
border: {
|
|
170
|
+
style: $border-style;
|
|
171
|
+
width: $font-unit * $width / $font-size; };
|
|
172
|
+
padding: $font-unit / $font-size * ($lines * $base-line-height - $width);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Apply a leading rhythm border
|
|
176
|
+
@mixin leading-border($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) {
|
|
177
|
+
@include apply-side-rhythm-border(top, $width, $lines, $font-size, $border-style);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Apply a trailing rhythm border
|
|
181
|
+
@mixin trailing-border($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) {
|
|
182
|
+
@include apply-side-rhythm-border(bottom, $width, $lines, $font-size, $border-style);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Apply both leading and trailing rhythm borders
|
|
186
|
+
@mixin horizontal-borders($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) {
|
|
187
|
+
@include leading-border($width, $lines, $font-size, $border-style);
|
|
188
|
+
@include trailing-border($width, $lines, $font-size, $border-style);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
@mixin h-borders($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) {
|
|
192
|
+
@include horizontal-borders($width, $lines, $font-size, $border-style);
|
|
193
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Set all the colors for a link with one mixin call.
|
|
2
|
+
// Order of arguments is:
|
|
3
|
+
//
|
|
4
|
+
// 1. normal
|
|
5
|
+
// 2. hover
|
|
6
|
+
// 3. active
|
|
7
|
+
// 4. visited
|
|
8
|
+
// 5. focus
|
|
9
|
+
//
|
|
10
|
+
// Those states not specified will inherit.
|
|
11
|
+
// Mixin to an anchor link like so:
|
|
12
|
+
// a
|
|
13
|
+
// +link-colors(#00c, #0cc, #c0c, #ccc, #cc0)
|
|
14
|
+
|
|
15
|
+
@mixin link-colors($normal, $hover: false, $active: false, $visited: false, $focus: false) {
|
|
16
|
+
color: $normal;
|
|
17
|
+
@if $visited {
|
|
18
|
+
&:visited {
|
|
19
|
+
color: $visited; } }
|
|
20
|
+
@if $focus {
|
|
21
|
+
&:focus {
|
|
22
|
+
color: $focus; } }
|
|
23
|
+
@if $hover {
|
|
24
|
+
&:hover {
|
|
25
|
+
color: $hover; } }
|
|
26
|
+
@if $active {
|
|
27
|
+
&:active {
|
|
28
|
+
color: $active; } } }
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Turn off the bullet for an element of a list
|
|
2
|
+
@mixin no-bullet {
|
|
3
|
+
list-style-image : none;
|
|
4
|
+
list-style-type : none;
|
|
5
|
+
margin-left : 0px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// turns off the bullets for an entire list
|
|
9
|
+
@mixin no-bullets {
|
|
10
|
+
list-style: none;
|
|
11
|
+
li { @include no-bullet; }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Make a list(ul/ol) have an image bullet.
|
|
15
|
+
//
|
|
16
|
+
// The mixin should be used like this for an icon that is 5x7:
|
|
17
|
+
//
|
|
18
|
+
// ul.pretty
|
|
19
|
+
// +pretty-bullets("my-icon.png", 5px, 7px)
|
|
20
|
+
//
|
|
21
|
+
// Additionally, if the image dimensions are not provided,
|
|
22
|
+
// The image dimensions will be extracted from the image itself.
|
|
23
|
+
//
|
|
24
|
+
// ul.pretty
|
|
25
|
+
// +pretty-bullets("my-icon.png")
|
|
26
|
+
//
|
|
27
|
+
@mixin pretty-bullets($bullet-icon, $width: image-width($bullet-icon), $height: image-height($bullet-icon), $line-height: 18px, $padding: 14px) {
|
|
28
|
+
margin-left: 0;
|
|
29
|
+
li {
|
|
30
|
+
padding-left: $padding;
|
|
31
|
+
background: image-url($bullet-icon) no-repeat ($padding - $width) / 2 ($line-height - $height) / 2;
|
|
32
|
+
list-style-type: none;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Horizontal list layout module.
|
|
2
|
+
//
|
|
3
|
+
// Easy mode using simple descendant li selectors:
|
|
4
|
+
//
|
|
5
|
+
// ul.nav
|
|
6
|
+
// +horizontal-list
|
|
7
|
+
//
|
|
8
|
+
// Advanced mode:
|
|
9
|
+
// If you need to target the list items using a different selector then use
|
|
10
|
+
// +horizontal-list-container on your ul/ol and +horizontal-list-item on your li.
|
|
11
|
+
// This may help when working on layouts involving nested lists. For example:
|
|
12
|
+
//
|
|
13
|
+
// ul.nav
|
|
14
|
+
// +horizontal-list-container
|
|
15
|
+
// > li
|
|
16
|
+
// +horizontal-list-item
|
|
17
|
+
|
|
18
|
+
@import "bullets";
|
|
19
|
+
@import "compass/utilities/general/clearfix";
|
|
20
|
+
@import "compass/utilities/general/reset";
|
|
21
|
+
@import "compass/utilities/general/float";
|
|
22
|
+
|
|
23
|
+
// Can be mixed into any selector that target a ul or ol that is meant
|
|
24
|
+
// to have a horizontal layout. Used to implement +horizontal-list.
|
|
25
|
+
@mixin horizontal-list-container {
|
|
26
|
+
@include reset-box-model;
|
|
27
|
+
@include clearfix; }
|
|
28
|
+
|
|
29
|
+
// Can be mixed into any li selector that is meant to participate in a horizontal layout.
|
|
30
|
+
// Used to implement +horizontal-list.
|
|
31
|
+
//
|
|
32
|
+
// :last-child is not fully supported
|
|
33
|
+
// see http://www.quirksmode.org/css/contents.html#t29 for the support matrix
|
|
34
|
+
//
|
|
35
|
+
// IE8 ignores rules that are included on the same line as :last-child
|
|
36
|
+
// see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details
|
|
37
|
+
//
|
|
38
|
+
// Setting `$padding` to `false` disables the padding between list elements
|
|
39
|
+
@mixin horizontal-list-item($padding: 4px, $direction: left) {
|
|
40
|
+
@include no-bullet;
|
|
41
|
+
white-space: nowrap;
|
|
42
|
+
@include float($direction);
|
|
43
|
+
@if $padding {
|
|
44
|
+
padding: {
|
|
45
|
+
left: $padding;
|
|
46
|
+
right: $padding;
|
|
47
|
+
}
|
|
48
|
+
&:first-child, &.first { padding-#{$direction}: 0; }
|
|
49
|
+
&:last-child { padding-#{opposite-position($direction)}: 0; }
|
|
50
|
+
&.last { padding-#{opposite-position($direction)}: 0; }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// A list(ol,ul) that is layed out such that the elements are floated left and won't wrap.
|
|
55
|
+
// This is not an inline list.
|
|
56
|
+
//
|
|
57
|
+
// Setting `$padding` to `false` disables the padding between list elements
|
|
58
|
+
@mixin horizontal-list($padding: 4px, $direction: left) {
|
|
59
|
+
@include horizontal-list-container;
|
|
60
|
+
li {
|
|
61
|
+
@include horizontal-list-item($padding, $direction); } }
|