bitstyles 0.8.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/PULL_REQUEST_TEMPLATE.md +6 -10
- data/.nvmrc +1 -1
- data/.stylelintrc +1 -164
- data/.travis.yml +19 -0
- data/README.md +66 -33
- data/bitstyles.gemspec +1 -1
- data/lib/bitstyles/version.rb +1 -1
- data/package.json +21 -17
- data/scss/bitstyles.scss +53 -45
- data/scss/bitstyles/base/_all.scss +7 -0
- data/scss/bitstyles/base/_figure.scss +1 -1
- data/scss/bitstyles/base/_forms.scss +31 -26
- data/scss/bitstyles/base/_hr.scss +1 -1
- data/scss/bitstyles/base/_images.scss +1 -1
- data/scss/bitstyles/base/_link.scss +2 -14
- data/scss/bitstyles/base/_media.scss +2 -2
- data/scss/bitstyles/base/_typography.scss +37 -89
- data/scss/bitstyles/components/_expander.scss +8 -5
- data/scss/bitstyles/components/_modal.scss +41 -26
- data/scss/bitstyles/generic/_all.scss +2 -0
- data/scss/bitstyles/layout/_content.scss +7 -3
- data/scss/bitstyles/layout/_grid.scss +46 -23
- data/scss/bitstyles/layout/_topbar.scss +19 -4
- data/scss/bitstyles/layout/_width.scss +18 -11
- data/scss/bitstyles/objects/_absolute-center.scss +8 -2
- data/scss/bitstyles/objects/_absolute-cover.scss +11 -2
- data/scss/bitstyles/objects/_block.scss +5 -2
- data/scss/bitstyles/objects/_bordered-header.scss +8 -3
- data/scss/bitstyles/objects/_break-long-words.scss +6 -3
- data/scss/bitstyles/objects/_button--icon.scss +8 -4
- data/scss/bitstyles/objects/_button.scss +22 -13
- data/scss/bitstyles/objects/_clearfix.scss +7 -4
- data/scss/bitstyles/objects/_fixed-ratio.scss +24 -9
- data/scss/bitstyles/objects/_flex.scss +12 -8
- data/scss/bitstyles/objects/_hidden.scss +10 -7
- data/scss/bitstyles/objects/_icon.scss +19 -11
- data/scss/bitstyles/objects/_input.scss +16 -9
- data/scss/bitstyles/objects/_label.scss +2 -2
- data/scss/bitstyles/objects/_link.scss +18 -15
- data/scss/bitstyles/objects/_list-inline.scss +26 -0
- data/scss/bitstyles/objects/_list-reset.scss +5 -3
- data/scss/bitstyles/objects/_media.scss +9 -2
- data/scss/bitstyles/objects/_object-cover.scss +20 -0
- data/scss/bitstyles/objects/_overflow.scss +20 -0
- data/scss/bitstyles/objects/_truncate-with-ellipsis.scss +4 -3
- data/scss/bitstyles/objects/_typography.scss +8 -62
- data/scss/bitstyles/objects/_vertical-center.scss +5 -2
- data/scss/bitstyles/objects/_visuallyhidden.scss +10 -6
- data/scss/bitstyles/settings/_button.scss +1 -1
- data/scss/bitstyles/settings/_content.scss +2 -3
- data/scss/bitstyles/settings/_fixed-ratio.scss +3 -0
- data/scss/bitstyles/settings/_global.breakpoints.scss +5 -5
- data/scss/bitstyles/settings/_global.color-palette.scss +47 -0
- data/scss/bitstyles/settings/_global.layout.scss +7 -5
- data/scss/bitstyles/settings/_global.typography.scss +25 -17
- data/scss/bitstyles/settings/_grid.scss +1 -1
- data/scss/bitstyles/settings/_hidden.scss +1 -1
- data/scss/bitstyles/settings/_icon.scss +3 -3
- data/scss/bitstyles/settings/_input.scss +4 -4
- data/scss/bitstyles/settings/_link.scss +4 -0
- data/scss/bitstyles/settings/_modal.scss +2 -1
- data/scss/bitstyles/settings/_topbar.scss +4 -2
- data/scss/bitstyles/settings/_visuallyhidden.scss +1 -1
- data/scss/bitstyles/settings/_width.scss +1 -1
- data/scss/bitstyles/tools/_absolute-center.scss +8 -3
- data/scss/bitstyles/tools/_absolute-cover.scss +8 -2
- data/scss/bitstyles/tools/_all.scss +23 -0
- data/scss/bitstyles/tools/_block.scss +5 -2
- data/scss/bitstyles/tools/_break-long-words.scss +6 -2
- data/scss/bitstyles/tools/_clearfix.scss +7 -2
- data/scss/bitstyles/tools/_fixed-ratio.scss +41 -4
- data/scss/bitstyles/tools/_flex.scss +7 -3
- data/scss/bitstyles/tools/_font-face.scss +11 -2
- data/scss/bitstyles/tools/_hidden.scss +5 -2
- data/scss/bitstyles/tools/_link.scss +25 -0
- data/scss/bitstyles/tools/_list-reset.scss +7 -3
- data/scss/bitstyles/tools/_media-query.scss +14 -7
- data/scss/bitstyles/tools/_media.scss +10 -3
- data/scss/bitstyles/tools/_overflow.scss +19 -0
- data/scss/bitstyles/tools/_palette.scss +28 -0
- data/scss/bitstyles/tools/_spacing.scss +22 -0
- data/scss/bitstyles/tools/_truncate-with-ellipsis.scss +7 -3
- data/scss/bitstyles/tools/_typography-conversions.scss +20 -7
- data/scss/bitstyles/tools/_typography.scss +124 -5
- data/scss/bitstyles/tools/_vertical-center.scss +5 -2
- data/scss/bitstyles/tools/_visuallyhidden.scss +9 -6
- data/scss/bitstyles/tools/_width.scss +10 -1
- data/scss/bitstyles/tools/_zindex.scss +34 -14
- data/scss/bitstyles/trumps/_background-color.scss +8 -3
- data/scss/bitstyles/trumps/_color.scss +8 -3
- data/scss/bitstyles/trumps/_margin.scss +5 -5
- data/scss/bitstyles/trumps/_no-margin.scss +5 -5
- data/scss/bitstyles/trumps/_no-padding.scss +5 -5
- data/scss/bitstyles/trumps/_padding.scss +5 -5
- data/scss/bitstyles/trumps/_text-align.scss +3 -4
- data/scss/bitstyles/trumps/_text-style.scss +4 -2
- data/scss/bitstyles/trumps/_text-weight.scss +6 -3
- data/yarn.lock +6511 -0
- metadata +16 -14
- data/build/.gitignore +0 -4
- data/scripts/styleguide.sh +0 -16
- data/scss/bitstyles/objects/_expander.scss +0 -45
- data/scss/bitstyles/settings/_global.color-theme.scss +0 -11
@@ -2,15 +2,19 @@
|
|
2
2
|
//
|
3
3
|
// Content
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// **A generic wrapper for content with side padding and a maximum width**.
|
6
|
+
//
|
7
|
+
// This layout object ensures:
|
8
|
+
// - there is always whitespace at the sides of the viewport; content will never touch the edge.
|
9
|
+
// - content spans the full width of the screen, up to a maximum set by `$bitstyles-content-max-width`
|
10
|
+
// - content remains centred within its parent element.
|
7
11
|
//
|
8
12
|
// markup:
|
9
13
|
// <div class="l-content">
|
10
14
|
// <p>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer. Gummies cheesecake oat cake sugar plum icing cupcake tiramisu bonbon. Cotton candy chupa chups tootsie roll chupa chups cotton candy liquorice jelly gingerbread. Pastry gummi bears liquorice tart cotton candy marshmallow. Ice cream cotton candy chocolate cake cookie. Bonbon candy jelly-o sugar plum cotton candy carrot cake icing ice cream. Sweet chocolate marzipan. Candy canes danish cake carrot cake bonbon. Gummi bears sesame snaps tart bear claw pie chocolate bar. Ice cream candy canes sugar plum cookie. Macaroon biscuit biscuit carrot cake liquorice. Muffin pudding gingerbread powder jelly-o chocolate bar powder jelly beans toffee.</p>
|
11
15
|
// </div>
|
12
16
|
//
|
13
|
-
// Styleguide
|
17
|
+
// Styleguide 3.1
|
14
18
|
|
15
19
|
@import '../settings/content';
|
16
20
|
|
@@ -1,22 +1,33 @@
|
|
1
1
|
// Grid Systems
|
2
2
|
//
|
3
|
-
//
|
4
|
-
// Note this means whitespace is important. If necessary, use html comments between
|
5
|
-
// each `.grid__item` to remove any whitespace, otherwise the browser will display
|
6
|
-
// a small gap between grid items.
|
3
|
+
// **A responsive html grid system using inline-block** (no floats, no clearfix, no flexbox).
|
7
4
|
//
|
8
|
-
//
|
9
|
-
//
|
5
|
+
// Note this means *whitespace is important*. If necessary, use html comments between
|
6
|
+
// each `.l-grid__item` to remove any whitespace (see the markup example below),
|
7
|
+
// otherwise the browser will display a small gap between grid items.
|
8
|
+
//
|
9
|
+
// As it’s an HTML grid system (not CSS), some wrapping elements are needed to create rows
|
10
|
+
// and columns (again see the markup in the examples below). Each of these grid items needs the class
|
11
|
+
// `.l-grid__item` and a width class. With current defaults, the widths provided
|
12
|
+
// include a 12-column system e.g. 1-of-12, 2-of-12, 3-of-12 … 11-of-12, 12-of-12.
|
13
|
+
//
|
14
|
+
// Grids can be nested.
|
10
15
|
//
|
11
16
|
// Dependencies:
|
12
17
|
// - `layout/width`
|
13
|
-
// - `tools/width`
|
14
18
|
//
|
15
|
-
// Styleguide
|
19
|
+
// Styleguide 3.2
|
16
20
|
|
17
21
|
// Grid system — base
|
18
22
|
//
|
19
|
-
//
|
23
|
+
// **In the base grid system, columns are of proportional widths (a percentage of
|
24
|
+
// the full width) but not responsive**.
|
25
|
+
//
|
26
|
+
// This means e.g. they cannot change from being 3-column
|
27
|
+
// on larger screens, to one column stacked on small screens (if you can, try
|
28
|
+
// resizing your browser window to see that the number of columns in the example
|
29
|
+
// below doesn’t change). See the Responsive Grid below for information on how
|
30
|
+
// to make your grid responsive.
|
20
31
|
//
|
21
32
|
// markup:
|
22
33
|
// <ul class="l-grid">
|
@@ -103,7 +114,7 @@
|
|
103
114
|
// </li>
|
104
115
|
// </ul>
|
105
116
|
//
|
106
|
-
// Styleguide
|
117
|
+
// Styleguide 3.2.1
|
107
118
|
|
108
119
|
@import '../settings/grid';
|
109
120
|
|
@@ -117,32 +128,44 @@
|
|
117
128
|
display: inline-block;
|
118
129
|
width: 100%;
|
119
130
|
padding-left: $bitstyles-grid-gutter;
|
120
|
-
box-sizing: border-box;
|
121
131
|
vertical-align: top;
|
132
|
+
box-sizing: border-box;
|
122
133
|
}
|
123
134
|
|
124
135
|
// Grid system - responsive
|
125
136
|
//
|
126
|
-
// The grid system can also be used responsively
|
127
|
-
//
|
128
|
-
//
|
129
|
-
//
|
137
|
+
// **The grid system can also be used responsively — setting different widths for an
|
138
|
+
// element based on the viewport size**.
|
139
|
+
//
|
140
|
+
// To do this, append the name of a breakpoint
|
141
|
+
// to the width class to have it activate only at that breakpoint e.g.
|
142
|
+
// `.l-width--12-of-12.l-width--6-of-12@medium` to create an element that’s
|
143
|
+
// fullwidth for all screens, then becomes half width for `medium`-screens and larger.
|
144
|
+
// Multiple l-width--item/breakpoints combinations can be used to define a grid item’s width
|
145
|
+
// at several breakpoints (for all the breakpoints defined in the
|
146
|
+
// `$bitstyles-widths-breakpoints` Sass list).
|
130
147
|
//
|
131
148
|
// This is commonly used to set a default mobile-first width of `.l-width--12-of-12`
|
132
|
-
// and a larger-screen width of e.g. `.l-width--4-of-12
|
149
|
+
// and a larger-screen width of e.g. `.l-width--4-of-12@medium` for a
|
133
150
|
// three-column layout that becomes a single-column stack on small screens.
|
134
151
|
//
|
135
152
|
// markup:
|
136
153
|
// <ul class="l-grid">
|
137
|
-
// <li class="l-grid__item l-width--
|
138
|
-
// <div class="background-grey">6-of-12 /
|
154
|
+
// <li class="l-grid__item l-width--6-of-12 l-width--4-of-12@medium">
|
155
|
+
// <div class="background-grey">6-of-12 / 4-of-12@medium</div>
|
156
|
+
// </li><!--
|
157
|
+
//--><li class="l-grid__item l-width--6-of-12 l-width--4-of-12@medium">
|
158
|
+
// <div>6-of-12 / 4-of-12@medium</div>
|
159
|
+
// </li><!--
|
160
|
+
//--><li class="l-grid__item l-width--6-of-12 l-width--4-of-12@medium">
|
161
|
+
// <div class="background-grey">6-of-12 / 4-of-12@medium</div>
|
139
162
|
// </li><!--
|
140
|
-
//--><li class="l-grid__item l-width--12-of-12 l-width--
|
141
|
-
// <div>
|
163
|
+
//--><li class="l-grid__item l-width--12-of-12 l-width--6-of-12@medium">
|
164
|
+
// <div class="background-grey">12-of-12 / 6-of-12@medium</div>
|
142
165
|
// </li><!--
|
143
|
-
//--><li class="l-grid__item l-width--12-of-12 l-width--
|
144
|
-
// <div
|
166
|
+
//--><li class="l-grid__item l-width--12-of-12 l-width--6-of-12@medium">
|
167
|
+
// <div>12-of-12 / 6-of-12@medium</div>
|
145
168
|
// </li>
|
146
169
|
// </ul>
|
147
170
|
//
|
148
|
-
// Styleguide
|
171
|
+
// Styleguide 3.2.2
|
@@ -2,14 +2,25 @@
|
|
2
2
|
//
|
3
3
|
// Topbar
|
4
4
|
//
|
5
|
-
//
|
5
|
+
// A fixed-position element that sticks to the top of the viewport, and spans
|
6
|
+
// its full width. Commonly used to contain site navigation, logo etc.
|
7
|
+
// Note that as it’s fixed, the main content element will need padding at the top
|
8
|
+
// to ensure it’s not obscured by the topbar.
|
6
9
|
//
|
7
10
|
// markup:
|
8
11
|
// <header class="l-topbar">
|
9
|
-
// <h1
|
12
|
+
// <h1 class="o-h2 t-no-margin">Logo, menu, search, and other important nav</h1>
|
10
13
|
// </header>
|
11
14
|
//
|
12
|
-
//
|
15
|
+
// sg-wrapper:
|
16
|
+
// <div class="fixed-height-block new-render-context">
|
17
|
+
// <sg-wrapper-content/>
|
18
|
+
// <div class="fixed-height-block">
|
19
|
+
// <div class="min-height-block background-grey">Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer. Gummies cheesecake oat cake sugar plum icing cupcake tiramisu bonbon. Cotton candy chupa chups tootsie roll chupa chups cotton candy liquorice jelly gingerbread. Pastry gummi bears liquorice tart cotton candy marshmallow. Ice cream cotton candy chocolate cake cookie. Bonbon candy jelly-o sugar plum cotton candy carrot cake icing ice cream. Sweet chocolate marzipan. Candy canes danish cake carrot cake bonbon. Gummi bears sesame snaps tart bear claw pie chocolate bar. Ice cream candy canes sugar plum cookie. Macaroon biscuit biscuit carrot cake liquorice. Muffin pudding gingerbread powder jelly-o chocolate bar powder jelly beans toffee.</div>
|
20
|
+
// </div>
|
21
|
+
// </div>
|
22
|
+
//
|
23
|
+
// Styleguide 3.3
|
13
24
|
|
14
25
|
@import '../settings/topbar';
|
15
26
|
|
@@ -20,6 +31,10 @@
|
|
20
31
|
left: 0;
|
21
32
|
z-index: z($bitstyles-global-z, topbar);
|
22
33
|
padding: $bitstyles-topbar-vertical-padding $bitstyles-topbar-horizontal-padding;
|
23
|
-
|
34
|
+
color: $bitstyles-topbar-color;
|
35
|
+
background-color: $bitstyles-topbar-background-color;
|
36
|
+
transition:
|
37
|
+
background-color $bitstyles-transition-duration $bitstyles-transition-easing,
|
38
|
+
transform 0.3s $bitstyles-transition-easing;
|
24
39
|
backface-visibility: hidden;
|
25
40
|
}
|
@@ -1,22 +1,29 @@
|
|
1
1
|
// Widths
|
2
2
|
//
|
3
|
-
//
|
4
|
-
// grid system (see our grid system), but can be used alone if needed (as shown here).
|
3
|
+
// **Bitstyles provides a series of classes focused on controlling width**.
|
5
4
|
//
|
6
|
-
//
|
7
|
-
//
|
5
|
+
// They’re most commonly used as part of a grid system (see our [grid system](/section/3.2)
|
6
|
+
// for more information on that), but should also be used alone if setting an
|
7
|
+
// element’s width is needed — as shown here — *instead of defining widths in a new CSS component*.
|
8
|
+
//
|
9
|
+
// Set the `$bitstyles-widths` variable to define how many columns you need. To create multiple grid
|
10
|
+
// systems with different numbers of equal-width columns you can specify more than one column-count
|
11
|
+
// (most often only on is needed though) e.g. `$bitstyles-widths: (10, 12)` creates
|
12
|
+
// classes that can be used to split a row into 10 or 12 columns:
|
8
13
|
//
|
9
14
|
// `.l-width--1-of-10` … `.l-width--10-of-10`
|
10
15
|
//
|
11
16
|
// `.l-width--1-of-12` … `.l-width--12-of-12`.
|
12
17
|
//
|
13
|
-
// If you define `$bitstyles-widths-breakpoints` to contain the names
|
14
|
-
// breakpoints (defaults to just `medium
|
15
|
-
//
|
18
|
+
// If you define the `$bitstyles-widths-breakpoints` Sass list to contain the names
|
19
|
+
// of one or more breakpoints (it defaults to just `medium`), widths will also
|
20
|
+
// be created that apply only at those breakpoints:
|
16
21
|
//
|
17
|
-
// `.l-width--
|
22
|
+
// `.l-width--1-of-12@medium`…
|
18
23
|
//
|
19
|
-
//
|
24
|
+
// This allows you to create an element that is displayed at different sizes based on
|
25
|
+
// viewport size. See the section on [responsive grid systems](/section/3.2.2) for
|
26
|
+
// an example of the most common uses for this.
|
20
27
|
//
|
21
28
|
// Requires:
|
22
29
|
// - `settings/widths`
|
@@ -33,7 +40,7 @@
|
|
33
40
|
// <div class="background-grey">6-of-12</div>
|
34
41
|
// </div>
|
35
42
|
//
|
36
|
-
// Styleguide
|
43
|
+
// Styleguide 3.4
|
37
44
|
|
38
45
|
@import '../settings/width';
|
39
46
|
|
@@ -42,7 +49,7 @@
|
|
42
49
|
@each $width-breakpoint in $bitstyles-widths-breakpoints {
|
43
50
|
@include media-query($width-breakpoint) {
|
44
51
|
@each $i in $bitstyles-widths {
|
45
|
-
@include width($i,
|
52
|
+
@include width($i, \@#{$width-breakpoint});
|
46
53
|
}
|
47
54
|
}
|
48
55
|
}
|
@@ -2,14 +2,20 @@
|
|
2
2
|
//
|
3
3
|
// Absolute Center
|
4
4
|
//
|
5
|
-
// Centres an element vertically & horizontally
|
5
|
+
// **Centres an element vertically & horizontally**, relative to its closest non-statically
|
6
|
+
// positioned parent element.
|
7
|
+
//
|
8
|
+
// This object class makes use of `position: absolute`
|
9
|
+
// so the element is no longer in the document flow and has no width or height as
|
10
|
+
// far as the parent element is concerned — the parent element must instead provide
|
11
|
+
// the dimensions for the `.o-absolute-center` to align itself to.
|
6
12
|
//
|
7
13
|
// markup:
|
8
14
|
// <div class="background-grey min-height-block">
|
9
15
|
// <p class="o-absolute-center">Centred content</p>
|
10
16
|
// </div>
|
11
17
|
//
|
12
|
-
// Styleguide 1
|
18
|
+
// Styleguide 4.1
|
13
19
|
|
14
20
|
.#{$bitstyles-namespace}o-absolute-center {
|
15
21
|
@include absolute-center;
|
@@ -2,14 +2,23 @@
|
|
2
2
|
//
|
3
3
|
// Absolute Cover
|
4
4
|
//
|
5
|
-
//
|
5
|
+
// **An element that covers its parent element from edge to edge** — vertically and
|
6
|
+
// horizontally — **regardless of how it may stretch**.
|
7
|
+
//
|
8
|
+
// Not recommended for images, media etc. (elements width inherent dimensions) due
|
9
|
+
// to that. This is most commonly used for container elements.
|
6
10
|
//
|
7
11
|
// markup:
|
8
12
|
// <div class="o-absolute-cover background-grey">
|
9
13
|
// <p>Covering content</p>
|
10
14
|
// </div>
|
11
15
|
//
|
12
|
-
//
|
16
|
+
// sg-wrapper:
|
17
|
+
// <div class="min-height-block">
|
18
|
+
// <sg-wrapper-content/>
|
19
|
+
// </div>
|
20
|
+
//
|
21
|
+
// Styleguide 4.2
|
13
22
|
|
14
23
|
.#{$bitstyles-namespace}o-absolute-cover {
|
15
24
|
@include absolute-cover;
|
@@ -2,12 +2,15 @@
|
|
2
2
|
//
|
3
3
|
// Block
|
4
4
|
//
|
5
|
-
//
|
5
|
+
// **Forces an element to display as a block**, when it otherwise may be `inline`/
|
6
|
+
// `inline-block`. This can be used to force an inline element onto a ‘new line’,
|
7
|
+
// but also has implications for an element’s size (block elements expand horizontally
|
8
|
+
// to the available width).
|
6
9
|
//
|
7
10
|
// Markup:
|
8
11
|
// <span class="o-block background-grey">Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</span>
|
9
12
|
//
|
10
|
-
// Styleguide
|
13
|
+
// Styleguide 4.3
|
11
14
|
|
12
15
|
.#{$bitstyles-namespace}o-block {
|
13
16
|
@include block;
|
@@ -2,12 +2,17 @@
|
|
2
2
|
//
|
3
3
|
// Bordered Header
|
4
4
|
//
|
5
|
-
// Creates equally-sized horizontal lines to the left & right of the
|
5
|
+
// Creates equally-sized horizontal lines to the left & right of the text within
|
6
|
+
// the element.
|
7
|
+
//
|
8
|
+
// The text is centered and the lines are of equal length. No background colour tricks
|
9
|
+
// are used, so it can be used on any background — including images (some current techniques
|
10
|
+
// for this cannot).
|
6
11
|
//
|
7
12
|
// markup:
|
8
13
|
// <h2 class="o-bordered-header">Bordered header</h2>
|
9
14
|
//
|
10
|
-
// Styleguide
|
15
|
+
// Styleguide 4.4
|
11
16
|
|
12
17
|
@import '../settings/bordered-header';
|
13
18
|
|
@@ -22,9 +27,9 @@
|
|
22
27
|
&::before,
|
23
28
|
&::after {
|
24
29
|
display: inline-block;
|
30
|
+
min-width: $bitstyles-bordered-header-line-min-width;
|
25
31
|
vertical-align: middle;
|
26
32
|
flex-grow: 1;
|
27
|
-
min-width: $bitstyles-bordered-header-line-min-width;
|
28
33
|
border-top: $bitstyles-bordered-header-border;
|
29
34
|
content: '';
|
30
35
|
}
|
@@ -2,13 +2,16 @@
|
|
2
2
|
//
|
3
3
|
// Break long words
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// **Forces text content within an element to break if longer than the element is wide.**.
|
6
|
+
//
|
7
|
+
// A cross-browser friendly method of ensuring no words exceed the width of the
|
8
|
+
// container. Commonly used to ensure user-generated content doesn’t break or
|
9
|
+
// overflow your page layout.
|
7
10
|
//
|
8
11
|
// markup:
|
9
12
|
// <p class="o-break-long-words">LongcontentwithnolinebreaksgoeshereLongcontentwithnolinebreaksgoeshereLongcontentwithnolinebreaksgoeshereLongcontentwithnolinebreaksgoeshereLongcontentwithnolinebreaksgoeshere</p>
|
10
13
|
//
|
11
|
-
// Styleguide
|
14
|
+
// Styleguide 4.5
|
12
15
|
|
13
16
|
.#{$bitstyles-namespace}o-break-long-words {
|
14
17
|
@include break-long-words;
|
@@ -1,13 +1,17 @@
|
|
1
1
|
// Icon Button
|
2
2
|
//
|
3
|
+
// **A button with only an icon as visible content.**
|
4
|
+
//
|
3
5
|
// A specialised button type — (visible) content is intended to be only an icon.
|
4
|
-
//
|
5
|
-
//
|
6
|
+
// Commonly used for share buttons (facebook, twitter etc.).
|
7
|
+
// Specify the svg `<title>` when `<use>`ing the icon element so the button has
|
8
|
+
// valid text to use as button label (see example markup), or provide a
|
9
|
+
// [visuallyhidden](/section/4.22) element containing descriptive text as sibling to the icon.
|
6
10
|
//
|
7
11
|
// markup:
|
8
12
|
// <button class="o-button o-button--icon {$modifiers}">
|
9
13
|
// <svg class="o-icon">
|
10
|
-
// <title>
|
14
|
+
// <title>Share on twitter</title>
|
11
15
|
// <use xlink:href="assets/images/icons.svg#icon-twitter"></use>
|
12
16
|
// </svg>
|
13
17
|
// </button>
|
@@ -16,7 +20,7 @@
|
|
16
20
|
// :hover - Hover state.
|
17
21
|
// :focus - Focus state.
|
18
22
|
//
|
19
|
-
// Styleguide
|
23
|
+
// Styleguide 4.6
|
20
24
|
|
21
25
|
@import '../settings/button--icon';
|
22
26
|
|
@@ -1,12 +1,18 @@
|
|
1
1
|
/** @define button */
|
2
2
|
//
|
3
|
-
//
|
3
|
+
// Buttons
|
4
4
|
//
|
5
|
-
//
|
5
|
+
// **Buttons perform actions (they’re not links, nor navigation)**, and are ideally a `<button>`
|
6
|
+
// element. Sometimes out of technical necessity this class can be applied to `<a>` elements
|
7
|
+
// but beware — that’s code smell…
|
8
|
+
//
|
9
|
+
// Styleguide 4.7
|
6
10
|
|
7
11
|
// Button - generic
|
8
12
|
//
|
9
|
-
// Produces a larger-than-text hit target
|
13
|
+
// **Produces a larger-than-text hit target**. Intended to be an action,
|
14
|
+
// not a link, therefore most often a `<button>` rather than `<a href="…">` (and never
|
15
|
+
// `<a href="#">`).
|
10
16
|
//
|
11
17
|
// markup:
|
12
18
|
// <button class="o-button {$modifiers}">
|
@@ -18,7 +24,7 @@
|
|
18
24
|
// :focus - Focus state.
|
19
25
|
// :disabled - Disabled state.
|
20
26
|
//
|
21
|
-
// Styleguide
|
27
|
+
// Styleguide 4.7.1
|
22
28
|
|
23
29
|
@import '../settings/button';
|
24
30
|
|
@@ -49,10 +55,10 @@
|
|
49
55
|
}
|
50
56
|
|
51
57
|
&:disabled {
|
52
|
-
background: $bitstyles-button-background-color-disabled;
|
53
|
-
border-color: $bitstyles-button-border-color-disabled;
|
54
58
|
color: $bitstyles-button-color-disabled;
|
55
59
|
cursor: default;
|
60
|
+
background: $bitstyles-button-background-color-disabled;
|
61
|
+
border-color: $bitstyles-button-border-color-disabled;
|
56
62
|
}
|
57
63
|
}
|
58
64
|
|
@@ -64,35 +70,38 @@
|
|
64
70
|
|
65
71
|
// Button - with icon
|
66
72
|
//
|
67
|
-
//
|
68
|
-
//
|
73
|
+
// **The same base button can contain an optional decorative icon**.
|
74
|
+
//
|
75
|
+
// Here it’s placed before the text. Source order dictates icon position. There must be no whitespace between the icon and text — can be achieved using comments as shown here.
|
69
76
|
//
|
70
77
|
// markup:
|
71
78
|
// <button class="o-button {$modifiers}">
|
72
|
-
// <svg class="o-button__icon o-icon"><use xlink:href="assets/images/icons.svg#icon-twitter"></use></svg
|
79
|
+
// <svg class="o-button__icon o-icon"><use xlink:href="assets/images/icons.svg#icon-twitter"></use></svg><!--
|
80
|
+
// --><span class="o-button__label">Button Text</span>
|
73
81
|
// </button>
|
74
82
|
//
|
75
83
|
// - Base state
|
76
84
|
// :hover - Hover state.
|
77
85
|
// :focus - Focus state.
|
78
86
|
//
|
79
|
-
// Styleguide
|
87
|
+
// Styleguide 4.7.2
|
80
88
|
|
81
89
|
// Button - with icon, reversed
|
82
90
|
//
|
83
|
-
//
|
91
|
+
// **The same base button can contain an optional decorative icon**. Here it’s placed after the
|
84
92
|
// text. Source order dictates icon position.
|
85
93
|
//
|
86
94
|
// markup:
|
87
95
|
// <button class="o-button {$modifiers}">
|
88
|
-
// <span class="o-button__label">Button Text</span
|
96
|
+
// <span class="o-button__label">Button Text</span><!--
|
97
|
+
// --><svg class="o-button__icon o-icon"><use xlink:href="assets/images/icons.svg#icon-twitter"></use></svg>
|
89
98
|
// </button>
|
90
99
|
//
|
91
100
|
// - Base state
|
92
101
|
// :hover - Hover state.
|
93
102
|
// :focus - Focus state.
|
94
103
|
//
|
95
|
-
// Styleguide
|
104
|
+
// Styleguide 4.7.3
|
96
105
|
|
97
106
|
.#{$bitstyles-namespace}o-button__icon + .#{$bitstyles-namespace}o-button__label {
|
98
107
|
margin-left: $bitstyles-button-icon-spacing;
|