_scaffolding.scss 3.46 KB
Newer Older
1
//
2
// Scaffolding
3
// --------------------------------------------------
Jacob Thornton's avatar
Jacob Thornton committed
4

5

Mark Otto's avatar
Mark Otto committed
6
// Reset the box-sizing
7
8
9
10
//
// Heads up! This reset may cause conflicts with some third-party widgets.
// For recommendations on resolving such conflicts, see
// http://getbootstrap.com/getting-started/#third-box-sizing
Chris Rebert's avatar
Chris Rebert committed
11
12
13
14
15
// Credit: Jon Neal & CSS-Tricks
// http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/
html {
  box-sizing: border-box;
}
16
*,
17
18
*:before,
*:after {
Chris Rebert's avatar
Chris Rebert committed
19
  box-sizing: inherit;
Mark Otto's avatar
Mark Otto committed
20
21
22
}


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Make viewport responsive
//
// @viewport is supposed to eventually replace <meta name="viewport">. It's manually prefixed for forward-compatibility.
//
// @viewport is also needed because IE 10+ doesn't honor <meta name="viewport"> in some cases.
// (See http://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/)
//
// However, `device-width` is broken on IE 10 on Windows (Phone) 8,
// (see http://timkadlec.com/2013/01/windows-phone-8-and-device-width/
// and https://github.com/twbs/bootstrap/issues/10497)
// and the fix for that involves a snippet of JavaScript to sniff the user agent and apply some conditional CSS.
// See http://getbootstrap.com/getting-started/#support-ie10-width for the relevant hack.

@-moz-viewport      { width: device-width; }
@-ms-viewport       { width: device-width; }
@-o-viewport        { width: device-width; }
@-webkit-viewport   { width: device-width; }
@viewport           { width: device-width; }


43
// Body reset
Jacob Thornton's avatar
Jacob Thornton committed
44

45
html {
Mark Otto's avatar
Mark Otto committed
46
  font-size: $font-size-root;
47
48
49
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

Jacob Thornton's avatar
Jacob Thornton committed
50
body {
Mark Otto's avatar
Mark Otto committed
51
52
53
54
55
  font-family: $font-family-base;
  font-size: $font-size-base;
  line-height: $line-height-base;
  color: $text-color;
  background-color: $body-bg;
56
57
}

Chris Rebert's avatar
Chris Rebert committed
58
// Reset fonts for relevant elements
59
60
61
62
input,
button,
select,
textarea {
Mark Otto's avatar
Mark Otto committed
63
64
65
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
Jacob Thornton's avatar
Jacob Thornton committed
66
67
}

68

69
// Links
Jacob Thornton's avatar
Jacob Thornton committed
70
71

a {
Mark Otto's avatar
Mark Otto committed
72
  color: $link-color;
Jacob Thornton's avatar
Jacob Thornton committed
73
  text-decoration: none;
Zlatan Vasović's avatar
Zlatan Vasović committed
74
75
76

  &:hover,
  &:focus {
Mark Otto's avatar
Mark Otto committed
77
78
    color: $link-hover-color;
    text-decoration: $link-hover-decoration;
Zlatan Vasović's avatar
Zlatan Vasović committed
79
80
81
  }

  &:focus {
Mark Otto's avatar
Mark Otto committed
82
    @include tab-focus();
Zlatan Vasović's avatar
Zlatan Vasović committed
83
  }
Mark Otto's avatar
Mark Otto committed
84
}
85
86
87
88


// Images

Mark Otto's avatar
Mark Otto committed
89
img {
Mark Otto's avatar
Mark Otto committed
90
91
92
93
  vertical-align: middle;
}

// Responsive images (ensure images don't scale beyond their parents)
94
.img-responsive {
Mark Otto's avatar
Mark Otto committed
95
  @include img-responsive();
Mark Otto's avatar
Mark Otto committed
96
97
}

Mark Otto's avatar
Mark Otto committed
98
// Rounded corners
99
.img-rounded {
Mark Otto's avatar
Mark Otto committed
100
  @include border-radius($border-radius-lg);
101
102
}

103
// Image thumbnails
104
.img-thumbnail {
Mark Otto's avatar
Mark Otto committed
105
106
107
108
109
  padding: $thumbnail-padding;
  line-height: $line-height-base;
  background-color: $thumbnail-bg;
  border: 1px solid $thumbnail-border;
  border-radius: $thumbnail-border-radius;
110
  transition: all .2s ease-in-out;
Mark Otto's avatar
Mark Otto committed
111
  @include box-shadow(0 1px 2px rgba(0,0,0,.075));
112
113

  // Keep them at most 100% wide
Mark Otto's avatar
Mark Otto committed
114
  @include img-responsive(inline-block);
115
}
116

Mark Otto's avatar
Mark Otto committed
117
// Perfect circle
118
.img-circle {
119
  border-radius: 50%; // set radius in percents
120
}
121
122
123
124
125


// Horizontal rules

hr {
126
  margin-top: $spacer;
127
  margin-bottom: $spacer;
128
  border: 0;
129
  border-top: .0625rem solid $hr-border;
130
131
}

132

133
// Only display content to screen readers
134
//
135
136
137
// See: http://a11yproject.com/posts/how-to-hide-content/

.sr-only {
Mark Otto's avatar
Mark Otto committed
138
139
  position: absolute;
  width: 1px;
140
141
  height: 1px;
  padding: 0;
142
  margin: -1px;
Mark Otto's avatar
Mark Otto committed
143
  overflow: hidden;
144
  clip: rect(0,0,0,0);
Mark Otto's avatar
Mark Otto committed
145
  border: 0;
146
}
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162

// Use in conjunction with .sr-only to only display content when it's focused.
// Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
// Credit: HTML5 Boilerplate

.sr-only-focusable {
  &:active,
  &:focus {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
  }
}