_scaffolding.scss 2.56 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
11
*,
12
13
*:before,
*:after {
14
  box-sizing: border-box;
Mark Otto's avatar
Mark Otto committed
15
16
17
}


18
// Body reset
Jacob Thornton's avatar
Jacob Thornton committed
19

20
html {
Mark Otto's avatar
Mark Otto committed
21
  font-size: $font-size-root;
22
23
24
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

Jacob Thornton's avatar
Jacob Thornton committed
25
body {
Mark Otto's avatar
Mark Otto committed
26
27
28
29
30
  font-family: $font-family-base;
  font-size: $font-size-base;
  line-height: $line-height-base;
  color: $text-color;
  background-color: $body-bg;
31
32
}

Chris Rebert's avatar
Chris Rebert committed
33
// Reset fonts for relevant elements
34
35
36
37
input,
button,
select,
textarea {
Mark Otto's avatar
Mark Otto committed
38
39
40
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
Jacob Thornton's avatar
Jacob Thornton committed
41
42
}

43

44
// Links
Jacob Thornton's avatar
Jacob Thornton committed
45
46

a {
Mark Otto's avatar
Mark Otto committed
47
  color: $link-color;
Jacob Thornton's avatar
Jacob Thornton committed
48
  text-decoration: none;
Zlatan Vasović's avatar
Zlatan Vasović committed
49
50
51

  &:hover,
  &:focus {
Mark Otto's avatar
Mark Otto committed
52
53
    color: $link-hover-color;
    text-decoration: $link-hover-decoration;
Zlatan Vasović's avatar
Zlatan Vasović committed
54
55
56
  }

  &:focus {
Mark Otto's avatar
Mark Otto committed
57
    @include tab-focus();
Zlatan Vasović's avatar
Zlatan Vasović committed
58
  }
Mark Otto's avatar
Mark Otto committed
59
}
60
61


62
63
64
65
66
67
68
69
70
71
// Figures
//
// We reset this here because previously Normalize had no `figure` margins. This
// ensures we don't break anyone's use of the element.

figure {
  margin: 0;
}


72
73
// Images

Mark Otto's avatar
Mark Otto committed
74
img {
Mark Otto's avatar
Mark Otto committed
75
76
77
78
  vertical-align: middle;
}

// Responsive images (ensure images don't scale beyond their parents)
79
.img-responsive {
Mark Otto's avatar
Mark Otto committed
80
  @include img-responsive();
Mark Otto's avatar
Mark Otto committed
81
82
}

Mark Otto's avatar
Mark Otto committed
83
// Rounded corners
84
.img-rounded {
Mark Otto's avatar
Mark Otto committed
85
  @include border-radius($border-radius-lg);
86
87
}

88
// Image thumbnails
89
.img-thumbnail {
Mark Otto's avatar
Mark Otto committed
90
91
92
93
94
  padding: $thumbnail-padding;
  line-height: $line-height-base;
  background-color: $thumbnail-bg;
  border: 1px solid $thumbnail-border;
  border-radius: $thumbnail-border-radius;
95
  transition: all .2s ease-in-out;
Mark Otto's avatar
Mark Otto committed
96
  @include box-shadow(0 1px 2px rgba(0,0,0,.075));
97
98

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

Mark Otto's avatar
Mark Otto committed
102
// Perfect circle
103
.img-circle {
104
  border-radius: 50%; // set radius in percents
105
}
106
107
108
109
110


// Horizontal rules

hr {
111
  margin-top: $spacer;
112
  margin-bottom: $spacer;
113
  border: 0;
114
  border-top: .0625rem solid $hr-border;
115
116
}

117

118
// Only display content to screen readers
119
//
120
121
122
// See: http://a11yproject.com/posts/how-to-hide-content/

.sr-only {
Mark Otto's avatar
Mark Otto committed
123
124
  position: absolute;
  width: 1px;
125
126
  height: 1px;
  padding: 0;
127
  margin: -1px;
Mark Otto's avatar
Mark Otto committed
128
  overflow: hidden;
129
  clip: rect(0,0,0,0);
Mark Otto's avatar
Mark Otto committed
130
  border: 0;
131
}
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147

// 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;
  }
}