You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

519 lines
19 KiB

10 years ago
  1. ---
  2. layout : 'default'
  3. css : 'reset-page'
  4. element : 'reset'
  5. elementType : 'global'
  6. title : 'Reset'
  7. description : 'A reset is a set of normalized values for CSS properties that correct for abberations in browser defaults'
  8. type : 'UI Global'
  9. themes : ['Default', 'Basic', 'Resetcss']
  10. ---
  11. <link rel="stylesheet/less" type="text/css" href="/build/less/definitions/globals/reset.less" />
  12. <%- @partial('header', { tabs: { overview: 'Overview', test: 'Test' } }) %>
  13. <div class="main container">
  14. <div class="ui active tab" data-tab="overview">
  15. <h2 class="ui dividing header">What's In Our Reset</h2>
  16. <p>Semantic's default theme includes the latest <a href="http://necolas.github.io/normalize.css/">Normalize css</a> to provide a base line HTML reset. In addition, Semantic UI requires a <b>Box-sizing</b> reset, to make sure that elements handle width definitions in the same way.</p>
  17. <h2 class="ui dividing header">Reset Options</h2>
  18. <p>
  19. The <b>basic</b> themes <b>only</b> includes the required <code>box-sizing</code> reset and nothing else. The <b>resetcss</b> theme provides a version of <a href="http://meyerweb.com/eric/tools/css/reset/">ResetCSS</a>, a less opinionated css reset.
  20. </p>
  21. </div>
  22. <div class="ui tab" data-tab="test">
  23. <h2 class="ui dividing header">Reset Test</h2>
  24. <div class="Test">
  25. <h2 class="Test-describe"><code>html</code></h2>
  26. <h3 class="Test-it">should have sans-serif font family (opinionated)</h3>
  27. <div class="Test-run">
  28. abcdefghijklmnopqrstuvwxyz
  29. </div>
  30. <h2 class="Test-describe"><code>body</code></h2>
  31. <h3 class="Test-it">should have no margin (opinionated)</h3>
  32. <div class="Test-run">
  33. (there should be no red background visible on this page)
  34. </div>
  35. <h2 class="Test-describe"><code>article</code>, <code>aside</code>, <code>details</code>, <code>figure</code>, <code>figcaption</code>, <code>footer</code>, <code>header</code>, <code>hgroup</code>, <code>main</code>, <code>nav</code>, <code>section</code>, <code>summary</code></h2>
  36. <h3 class="Test-it">should render as block</h3>
  37. <div class="Test-run Test-run--highlightEl">
  38. <article>article</article>
  39. <aside>aside</aside>
  40. <details>
  41. <summary>summary</summary>
  42. details
  43. </details>
  44. <figure>
  45. figure
  46. <figcaption>figcaption</figcaption>
  47. </figure>
  48. <footer>footer</footer>
  49. <header>header</header>
  50. <hgroup>hgroup</hgroup>
  51. <main>main</main>
  52. <nav>nav</nav>
  53. <section>section</section>
  54. </div>
  55. <h2 class="Test-describe"><code>audio</code>, <code>canvas</code>, <code>progress</code>, <code>video</code></h2>
  56. <h3 class="Test-it">should render as inline-block and baseline-aligned</h3>
  57. <div class="Test-run Test-run--highlightEl">
  58. <audio controls>audio</audio>
  59. <canvas>canvas</canvas>
  60. <progress>progress</progress>
  61. <video controls>video</video>
  62. </div>
  63. <h2 class="Test-describe"><code>audio:not([controls])</code>, <code>template</code>, <code>[hidden]</code></h2>
  64. <h3 class="Test-it">should not display</h3>
  65. <div class="Test-run Test-run--highlightEl">
  66. <audio>audio</audio>
  67. <template>
  68. <h1>{{title}}</h1>
  69. <content></content>
  70. </template>
  71. <p hidden>This should be hidden</p>
  72. </div>
  73. <h2 class="Test-describe"><code>a</code></h2>
  74. <h3 class="Test-it">should have a transparent background when active</h3>
  75. <div class="Test-run">
  76. <a href="#non">dummy anchor</a>
  77. </div>
  78. <h3 class="Test-it">should not have a focus outline when both focused and hovered (opinionated)</h3>
  79. <div class="Test-run">
  80. <a href="#non">dummy anchor</a>
  81. </div>
  82. <h2 class="Test-describe"><code>abbr[title]</code></h2>
  83. <h3 class="Test-it">should have a dotted bottom border</h3>
  84. <div class="Test-run">
  85. <abbr title="abbreviation">abbr</abbr>
  86. </div>
  87. <h2 class="Test-describe"><code>b</code>, <code>strong</code></h2>
  88. <h3 class="Test-it">should have bold font-weight</h3>
  89. <div class="Test-run">
  90. <b>b</b>
  91. <strong>strong</strong>
  92. </div>
  93. <h2 class="Test-describe"><code>dfn</code></h2>
  94. <h3 class="Test-it">should have italic font-style</h3>
  95. <div class="Test-run">
  96. <dfn>dfn</dfn>
  97. </div>
  98. <h2 class="Test-describe"><code>h1</code></h2>
  99. <h3 class="Test-it">should not change size within an <code>article</code></h3>
  100. <div class="Test-run">
  101. <h1>Heading (control)</h1>
  102. <article>
  103. <h1>Heading (in article)</h1>
  104. </article>
  105. </div>
  106. <h3 class="Test-it">should not change size within a <code>section</code></h3>
  107. <div class="Test-run">
  108. <h1>Heading (control)</h1>
  109. <section>
  110. <h1>Heading (in section)</h1>
  111. </section>
  112. </div>
  113. <h2 class="Test-describe"><code>mark</code></h2>
  114. <h3 class="Test-it">should have a yellow background</h3>
  115. <div class="Test-run">
  116. <mark>mark</mark>
  117. </div>
  118. <h2 class="Test-describe"><code>small</code></h2>
  119. <h3 class="Test-it">should render equally small in all browsers</h3>
  120. <div class="Test-run">
  121. control. <small>small.</small>
  122. </div>
  123. <h2 class="Test-describe"><code>sub</code> and <code>sup</code></h2>
  124. <h3 class="Test-it">should not affect a line's visual line-height</h3>
  125. <div class="Test-run Test-run--highlightEl">
  126. <p>control.</p>
  127. <p>control. <sub>sub.</sub></p>
  128. <p>control. <sup>sup.</sup></p>
  129. </div>
  130. <h2 class="Test-describe"><code>img</code></h2>
  131. <h3 class="Test-it">should not have a border when wrapped in an anchor</h3>
  132. <div class="Test-run">
  133. <a href="#non">
  134. <!-- scaled-up 1px image -->
  135. <img style="background-color:#ADD8E6" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" width="100" height="100">
  136. </a>
  137. </div>
  138. <h2 class="Test-describe"><code>svg</code></h2>
  139. <h3 class="Test-it">should not overflow</h3>
  140. <div class="Test-run Test-run--highlightEl">
  141. <svg width="100px" height="100px">
  142. <circle cx="100" cy="100" r="100" fill="#ADD8E6" />
  143. </svg>
  144. </div>
  145. <h2 class="Test-describe"><code>figure</code></h2>
  146. <h3 class="Test-it">should have margins</h3>
  147. <div class="Test-run" style="outline:1px solid #ADD8E6; overflow:hidden;">
  148. <figure>
  149. <img style="background-color:#ADD8E6" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" width="400" height="200">
  150. </figure>
  151. </div>
  152. <h2 class="Test-describe"><code>hr</code></h2>
  153. <h3 class="Test-it">should have a <code>content-box</code> box model</h3>
  154. <div class="Test-run" style="">
  155. <hr style="height:2px; border:solid #ADD8E6; border-width:2px 0;">
  156. </div>
  157. <h2 class="Test-describe"><code>pre</code></h2>
  158. <h3 class="Test-it">should trigger a scrollbar when too wide for its container</h3>
  159. <div class="Test-run" style="max-width:300px; outline:1px solid #ADD8E6;">
  160. <pre>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et me.</pre>
  161. </div>
  162. <h2 class="Test-describe"><code>code</code>, <code>kbd</code>, <code>pre</code>, <code>samp</code></h2>
  163. <h3 class="Test-it">should render <code>em</code>-unit preformatted text at the same absolute size as normal text</h3>
  164. <div class="Test-run">
  165. <span>span: abcdefghijklmnopqrstuvwxyz.</span><br>
  166. <code>code: abcdefghijklmnopqrstuvwxyz.</code><br>
  167. <kbd>kbd: abcdefghijklmnopqrstuvwxyz.</kbd><br>
  168. <samp>samp: abcdefghijklmnopqrstuvwxyz.</samp>
  169. <pre>pre: abcdefghijklmnopqrstuvwxyz.</pre>
  170. </div>
  171. <h2 class="Test-describe"><code>button</code>, <code>input</code>, <code>optgroup</code>, <code>select</code>, <code>textarea</code></h2>
  172. <h3 class="Test-it">should inherit <code>color</code> from ancestor</h3>
  173. <div class="Test-run" style="color:#ADD8E6;">
  174. <button>button</button><br>
  175. <input value="input"><br>
  176. <select style="border:1px solid #999;">
  177. <optgroup label="optgroup">
  178. <option>option</option>
  179. </optgroup>
  180. <option>option</option>
  181. </select><br>
  182. <textarea>textarea</textarea>
  183. </div>
  184. <h3 class="Test-it">should inherit <code>font</code> from ancestor</h3>
  185. <div class="Test-run" style="font:bold italic 20px/1 serif;">
  186. <button>button</button><br>
  187. <input value="input"><br>
  188. <select style="border:1px solid #999;">
  189. <optgroup label="optgroup">
  190. <option>option</option>
  191. </optgroup>
  192. <option>option</option>
  193. </select><br>
  194. <textarea>textarea</textarea>
  195. </div>
  196. <h3 class="Test-it">should not have margins</h3>
  197. <div class="Test-run" id="form-collection-margins">
  198. <style>
  199. #form-collection-margins {
  200. outline: 1px solid #ADD8E6;
  201. overflow: hidden;
  202. }
  203. #form-collection-margins button,
  204. #form-collection-margins input,
  205. #form-collection-margins select,
  206. #form-collection-margins textarea {
  207. display: block;
  208. }
  209. </style>
  210. <button>button</button>
  211. <input value="input">
  212. <select style="border:1px solid #999;">
  213. <optgroup label="optgroup">
  214. <option>option</option>
  215. </optgroup>
  216. <option>option</option>
  217. </select>
  218. <textarea>textarea</textarea>
  219. </div>
  220. <h2 class="Test-describe"><code>button</code></h2>
  221. <h3 class="Test-it">should have visible overflow</h3>
  222. <div class="Test-run" id="button-overflow">
  223. <style>
  224. #button-overflow button:after {
  225. content: "";
  226. background: #ADD8E6;
  227. display: inline-block;
  228. height: 10px;
  229. position:relative;
  230. right: -20px;
  231. width: 10px;
  232. }
  233. </style>
  234. <button>abcdefghijklmnopqrstuvwxyz</button>
  235. </div>
  236. <h2 class="Test-describe"><code>button</code>, <code>select</code></h2>
  237. <h3 class="Test-it">should not inherit <code>text-transform</code></h3>
  238. <div class="Test-run" style="text-transform:uppercase">
  239. <button>button</button>
  240. <select><option>option</option></select>
  241. </div>
  242. <h2 class="Test-describe"><code>button</code> and button-style <code>input</code></h2>
  243. <h3 class="Test-it">should have <code>pointer</code> cursor style</h3>
  244. <div class="Test-run">
  245. <p><button>button</button></p>
  246. <p><input type="image" src="http://lorempixel.com/90/24" alt="input (image)"></p>
  247. <p><input type="button" value="input (button)"></p>
  248. <p><input type="reset" value="input (reset)"></p>
  249. <p><input type="submit" value="input (submit)"></p>
  250. </div>
  251. <h3 class="Test-it">should be styleable</h3>
  252. <div class="Test-run" id="button-like-style">
  253. <style>
  254. #button-like-style button,
  255. #button-like-style input {
  256. background: #ADD8E6;
  257. border: 2px solid black;
  258. border-radius: 2px;
  259. padding: 5px;
  260. }
  261. </style>
  262. <p><button>button</button></p>
  263. <p><input type="image" src="http://lorempixel.com/90/24" alt="input (image)"></p>
  264. <p><input type="button" value="input (button)"></p>
  265. <p><input type="reset" value="input (reset)"></p>
  266. <p><input type="submit" value="input (submit)"></p>
  267. </div>
  268. <h2 class="Test-describe">disabled <code>button</code> and <code>input</code></h2>
  269. <h3 class="Test-it">should have <code>default</code> cursor style</h3>
  270. <div class="Test-run">
  271. <p><button disabled>button</button></p>
  272. <p><input disabled type="image" src="http://lorempixel.com/90/24" alt="input (image)"></p>
  273. <p><input disabled type="button" value="input (button)"></p>
  274. <p><input disabled type="reset" value="input (reset)"></p>
  275. <p><input disabled type="submit" value="input (submit)"></p>
  276. </div>
  277. <h2 class="Test-describe"><code>button</code>, <code>input</code></h2>
  278. <h3 class="Test-it">should not have extra inner padding in Firefox</h3>
  279. <div class="Test-run" id="button-input-padding">
  280. <style>
  281. #button-input-padding button,
  282. #button-input-padding input {
  283. border: 0;
  284. padding: 0;
  285. outline: 1px solid #ADD8E6;
  286. }
  287. </style>
  288. <p><button>button</button></p>
  289. <p><input value="input (text)"></p>
  290. <p><input type="button" value="input (button)"></p>
  291. <p><input type="reset" value="input (reset)"></p>
  292. <p><input type="submit" value="input (submit)"></p>
  293. </div>
  294. <h2 class="Test-describe"><code>input</code></h2>
  295. <h3 class="Test-it">should not inherit <code>line-height</code></h3>
  296. <div class="Test-run" style="line-height:50px">
  297. <input value="input (text)">
  298. </div>
  299. <h2 class="Test-describe"><code>input[type="checkbox"]</code>, <code>input[type="radio"]</code></h2>
  300. <h3 class="Test-it">should have a <code>border-box</code> box model</h3>
  301. <div class="Test-run Test-run--highlightEl" id="radio-box-model">
  302. <style>
  303. #radio-box-model {
  304. width: 200px;
  305. border: 1px solid red;
  306. }
  307. #radio-box-model input {
  308. width: 100%;
  309. border: 5px solid #ADD8E6;
  310. display: block;
  311. position: relative;
  312. }
  313. </style>
  314. <input type="checkbox">
  315. <input type="radio" name="rad">
  316. </div>
  317. <h3 class="Test-it">should not have padding</h3>
  318. <div class="Test-run Test-run--highlightEl">
  319. <input type="checkbox">
  320. <input type="radio" name="rad">
  321. </div>
  322. <h2 class="Test-describe"><code>input[type="number"]</code></h2>
  323. <h3 class="Test-it">should display a default cursor for the decrement button's click target in Chrome</h3>
  324. <div class="Test-run">
  325. <input style="height:50px; font-size:15px;" type="number" id="in" min="0" max="10" value="5">
  326. </div>
  327. <h2 class="Test-describe"><code>input[type="search"]</code></h2>
  328. <h3 class="Test-it">should be styleable</h3>
  329. <div class="Test-run">
  330. <input type="search" style="border:1px solid #ADD8E6; padding:10px; width:200px;">
  331. </div>
  332. <h3 class="Test-it">should have a <code>content-box</code> box model</h3>
  333. <div class="Test-run">
  334. <div style="background:red; display:inline-block; height:62px; width:242px;">
  335. <input type="search" style="border:1px solid #ADD8E6; height:20px; padding:20px; width:200px;">
  336. </div>
  337. </div>
  338. <h3 class="Test-it">should not have a cancel button in Safari or Chrome</h3>
  339. <div class="Test-run">
  340. <input type="search" value="search">
  341. </div>
  342. <h2 class="Test-describe"><code>fieldset</code></h2>
  343. <h3 class="Test-it">should have consistent border, padding, and margin</h3>
  344. <div class="Test-run">
  345. <fieldset>
  346. <div style="width:100%; height:100px; background:#ADD8E6;"></div>
  347. </fieldset>
  348. </div>
  349. <h2 class="Test-describe"><code>legend</code></h2>
  350. <h3 class="Test-it">should inherit color</h3>
  351. <div class="Test-run" style="color:#ADD8E6;">
  352. <fieldset>
  353. <legend>legend</legend>
  354. </fieldset>
  355. </div>
  356. <h3 class="Test-it">should not have padding</h3>
  357. <div class="Test-run">
  358. <fieldset>
  359. <legend>legend</legend>
  360. </fieldset>
  361. </div>
  362. <h2 class="Test-describe"><code>textarea</code></h2>
  363. <h3 class="Test-it">should not have a scrollbar unless overflowing</h3>
  364. <div class="Test-run">
  365. <textarea>textarea</textarea>
  366. </div>
  367. <h2 class="Test-describe"><code>table</code></h2>
  368. <h3 class="Test-it">should not have spaces between cells</h3>
  369. <div class="Test-run">
  370. <table>
  371. <caption>Jimi Hendrix - albums</caption>
  372. <thead>
  373. <tr>
  374. <th>Album</th>
  375. <th>Year</th>
  376. <th>Price</th>
  377. </tr>
  378. </thead>
  379. <tfoot>
  380. <tr>
  381. <th>Album</th>
  382. <th>Year</th>
  383. <th>Price</th>
  384. </tr>
  385. </tfoot>
  386. <tbody>
  387. <tr>
  388. <td>Are You Experienced</td>
  389. <td>1967</td>
  390. <td>$10.00</td>
  391. </tr>
  392. <tr>
  393. <td>Axis: Bold as Love</td>
  394. <td>1967</td>
  395. <td>$12.00</td>
  396. </tr>
  397. <tr>
  398. <td>Electric Ladyland</td>
  399. <td>1968</td>
  400. <td>$10.00</td>
  401. </tr>
  402. <tr>
  403. <td>Band of Gypsys</td>
  404. <td>1970</td>
  405. <td>$12.00</td>
  406. </tr>
  407. </tbody>
  408. </table>
  409. </div>
  410. </div>
  411. </div>
  412. </div>
  413. <style>
  414. /*! suit-test v0.1.0 | MIT License | github.com/suitcss */
  415. .Test {
  416. background: #fff;
  417. counter-reset: test-describe;
  418. }
  419. .Test-describe:before {
  420. content: counter(test-describe);
  421. counter-increment: test-describe;
  422. }
  423. .Test-describe {
  424. counter-reset: test-it;
  425. }
  426. .Test-it:before {
  427. content: counter(test-describe) "." counter(test-it);
  428. counter-increment: test-it;
  429. }
  430. .Test-title {
  431. font-size: 2em;
  432. font-family: sans-serif;
  433. padding: 20px;
  434. margin: 20px 0;
  435. background: #eee;
  436. color: #999;
  437. }
  438. .Test-describe,
  439. .Test-it {
  440. background: #eee;
  441. border-left: 5px solid #666;
  442. color: #666;
  443. font-family: sans-serif;
  444. font-weight: bold;
  445. margin: 20px 0;
  446. padding: 0.75em 20px;
  447. }
  448. .Test-describe {
  449. font-size: 1.5em;
  450. margin: 60px 0 20px;
  451. }
  452. .Test-describe:before,
  453. .Test-it:before {
  454. color: #999;
  455. display: inline-block;
  456. margin-right: 10px;
  457. min-width: 30px;
  458. text-transform: uppercase;
  459. }
  460. /* Custom helpers */
  461. /**
  462. * Test whether the body's margin has been removed
  463. */
  464. body {
  465. background: red;
  466. }
  467. /**
  468. * Highlight the bounds of direct children of a test block
  469. */
  470. .Test-run--highlightEl > * {
  471. outline: 1px solid #ADD8E6;
  472. }
  473. </style>