_scaffolding.scss 3.3 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
  @include hover-focus {
Mark Otto's avatar
Mark Otto committed
76
77
    color: $link-hover-color;
    text-decoration: $link-hover-decoration;
Zlatan Vasović's avatar
Zlatan Vasović committed
78
79
80
  }

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


// Images

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

92
93
94
95
96
// Responsive images (ensure images don't scale beyond their parents)
.img-responsive {
  @include img-responsive();
}

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

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

  // Keep them at most 100% wide
113
  @include img-responsive(inline-block);
114
}
115

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


// Horizontal rules

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

131

Mark Otto's avatar
Mark Otto committed
132
133
134
135
136
137
138
139
140
141
// iOS "clickable elements" fix for role="button"
//
// Fixes "clickability" issue (and more generally, the firing of events such as focus as well)
// for traditionally non-focusable elements with role="button"
// see https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
// Upstream patch for normalize.css submitted: https://github.com/necolas/normalize.css/pull/379 - remove this fix once that is merged

[role="button"] {
  cursor: pointer;
}