html.css 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. /**
  2. * dompdf default stylesheet.
  3. *
  4. * @package dompdf
  5. * @link http://dompdf.github.com/
  6. * @author Benj Carson <benjcarson@digitaljunkies.ca>
  7. * @author Blake Ross <BlakeR1234@aol.com>
  8. * @author Fabien Ménager <fabien.menager@gmail.com>
  9. * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  10. *
  11. * Portions from Mozilla
  12. * @link https://dxr.mozilla.org/mozilla-central/source/layout/style/res/html.css
  13. * @license http://mozilla.org/MPL/2.0/ Mozilla Public License, v. 2.0
  14. *
  15. * Portions from W3C
  16. * @link https://drafts.csswg.org/css-ui-3/#default-style-sheet
  17. *
  18. */
  19. @page {
  20. margin: 1.2cm;
  21. }
  22. html {
  23. display: -dompdf-page !important;
  24. counter-reset: page;
  25. }
  26. /* blocks */
  27. article,
  28. aside,
  29. details,
  30. div,
  31. dt,
  32. figcaption,
  33. footer,
  34. form,
  35. header,
  36. hgroup,
  37. main,
  38. nav,
  39. noscript,
  40. section,
  41. summary {
  42. display: block;
  43. }
  44. body {
  45. page-break-before: avoid;
  46. display: block !important;
  47. counter-increment: page;
  48. }
  49. p, dl, multicol {
  50. display: block;
  51. margin: 1em 0;
  52. }
  53. dd {
  54. display: block;
  55. margin-left: 40px;
  56. }
  57. blockquote, figure {
  58. display: block;
  59. margin: 1em 40px;
  60. }
  61. address {
  62. display: block;
  63. font-style: italic;
  64. }
  65. center {
  66. display: block;
  67. text-align: center;
  68. }
  69. blockquote[type=cite] {
  70. display: block;
  71. margin: 1em 0;
  72. padding-left: 1em;
  73. border-left: solid;
  74. border-color: blue;
  75. border-width: thin;
  76. }
  77. h1, h2, h3, h4, h5, h6 {
  78. display: block;
  79. font-weight: bold;
  80. }
  81. h1 {
  82. font-size: 2em;
  83. margin: .67em 0;
  84. }
  85. h2 {
  86. font-size: 1.5em;
  87. margin: .83em 0;
  88. }
  89. h3 {
  90. font-size: 1.17em;
  91. margin: 1em 0;
  92. }
  93. h4 {
  94. margin: 1.33em 0;
  95. }
  96. h5 {
  97. font-size: 0.83em;
  98. margin: 1.67em 0;
  99. }
  100. h6 {
  101. font-size: 0.67em;
  102. margin: 2.33em 0;
  103. }
  104. listing {
  105. display: block;
  106. font-family: fixed;
  107. font-size: medium;
  108. white-space: pre;
  109. margin: 1em 0;
  110. }
  111. plaintext, pre, xmp {
  112. display: block;
  113. font-family: fixed;
  114. white-space: pre;
  115. margin: 1em 0;
  116. }
  117. /* tables */
  118. table {
  119. display: table;
  120. border-spacing: 2px;
  121. border-collapse: separate;
  122. margin-top: 0;
  123. margin-bottom: 0;
  124. text-indent: 0;
  125. text-align: left; /* quirk */
  126. }
  127. table[border] {
  128. border-style: outset;
  129. border-color: gray;
  130. }
  131. /* This won't work (???) */
  132. /*
  133. table[border] td,
  134. table[border] th {
  135. border: 1pt solid grey;
  136. }*/
  137. /* make sure backgrounds are inherited in tables -- see bug 4510 */
  138. td, th, tr {
  139. background-color: inherit;
  140. background-image: inherit;
  141. background-image-resolution: inherit;
  142. background-position: inherit;
  143. background-repeat: inherit;
  144. background-size: inherit;
  145. }
  146. /* caption inherits from table not table-outer */
  147. caption {
  148. display: table-caption;
  149. text-align: center;
  150. }
  151. tr {
  152. display: table-row;
  153. vertical-align: inherit;
  154. }
  155. col {
  156. display: table-column;
  157. }
  158. colgroup {
  159. display: table-column-group;
  160. }
  161. tbody {
  162. display: table-row-group;
  163. vertical-align: middle;
  164. }
  165. thead {
  166. display: table-header-group;
  167. vertical-align: middle;
  168. }
  169. tfoot {
  170. display: table-footer-group;
  171. vertical-align: middle;
  172. }
  173. /* To simulate tbody auto-insertion */
  174. table > tr {
  175. vertical-align: middle;
  176. }
  177. td {
  178. display: table-cell;
  179. vertical-align: inherit;
  180. text-align: inherit;
  181. padding: 1px;
  182. }
  183. th {
  184. display: table-cell;
  185. vertical-align: inherit;
  186. text-align: center;
  187. font-weight: bold;
  188. padding: 1px;
  189. }
  190. /* inlines */
  191. q {
  192. quotes: '"' '"' "'" "'"; /* FIXME only the first level is used */
  193. }
  194. q:before {
  195. content: open-quote;
  196. }
  197. q:after {
  198. content: close-quote;
  199. }
  200. :link {
  201. color: #00c;
  202. text-decoration: underline;
  203. }
  204. b, strong {
  205. font-weight: bolder;
  206. }
  207. i, cite, em, var, dfn {
  208. font-style: italic;
  209. }
  210. tt, code, kbd, samp {
  211. font-family: fixed;
  212. }
  213. u, ins {
  214. text-decoration: underline;
  215. }
  216. s, strike, del {
  217. text-decoration: line-through;
  218. }
  219. big {
  220. font-size: larger;
  221. }
  222. small {
  223. font-size: smaller;
  224. }
  225. sub {
  226. vertical-align: sub;
  227. font-size: smaller;
  228. line-height: normal;
  229. }
  230. sup {
  231. vertical-align: super;
  232. font-size: smaller;
  233. line-height: normal;
  234. }
  235. nobr {
  236. white-space: nowrap;
  237. }
  238. mark {
  239. background: yellow;
  240. color: black;
  241. }
  242. /* titles */
  243. abbr[title], acronym[title] {
  244. text-decoration: dotted underline;
  245. }
  246. /* lists */
  247. ul, menu, dir {
  248. display: block;
  249. list-style-type: disc;
  250. margin: 1em 0;
  251. padding-left: 40px;
  252. }
  253. ol {
  254. display: block;
  255. list-style-type: decimal;
  256. margin: 1em 0;
  257. padding-left: 40px;
  258. }
  259. li {
  260. display: list-item;
  261. }
  262. /*li:before {
  263. display: -dompdf-list-bullet !important;
  264. content: counter(-dompdf-default-counter) ". ";
  265. padding-right: 0.5em;
  266. }*/
  267. /* nested lists have no top/bottom margins */
  268. :matches(ul, ol, dir, menu, dl) ul,
  269. :matches(ul, ol, dir, menu, dl) ol,
  270. :matches(ul, ol, dir, menu, dl) dir,
  271. :matches(ul, ol, dir, menu, dl) menu,
  272. :matches(ul, ol, dir, menu, dl) dl {
  273. margin-top: 0;
  274. margin-bottom: 0;
  275. }
  276. /* 2 deep unordered lists use a circle */
  277. :matches(ul, ol, dir, menu) ul,
  278. :matches(ul, ol, dir, menu) ul,
  279. :matches(ul, ol, dir, menu) ul,
  280. :matches(ul, ol, dir, menu) ul {
  281. list-style-type: circle;
  282. }
  283. /* 3 deep (or more) unordered lists use a square */
  284. :matches(ul, ol, dir, menu) :matches(ul, ol, dir, menu) ul,
  285. :matches(ul, ol, dir, menu) :matches(ul, ol, dir, menu) menu,
  286. :matches(ul, ol, dir, menu) :matches(ul, ol, dir, menu) dir {
  287. list-style-type: square;
  288. }
  289. /* forms */
  290. /* From https://drafts.csswg.org/css-ui-3/#default-style-sheet */
  291. form {
  292. display: block;
  293. }
  294. input, button, select {
  295. display: inline-block;
  296. font-family: sans-serif;
  297. }
  298. input[type=text],
  299. input[type=password],
  300. select {
  301. width: 12em;
  302. }
  303. input[type=text],
  304. input[type=password],
  305. input[type=button],
  306. input[type=submit],
  307. input[type=reset],
  308. input[type=file],
  309. button,
  310. textarea,
  311. select {
  312. background: #FFF;
  313. border: 1px solid #999;
  314. padding: 2px;
  315. margin: 2px;
  316. }
  317. input[type=button],
  318. input[type=submit],
  319. input[type=reset],
  320. input[type=file],
  321. button {
  322. background: #CCC;
  323. text-align: center;
  324. }
  325. input[type=file] {
  326. width: 8em;
  327. }
  328. input[type=text]:before,
  329. input[type=button]:before,
  330. input[type=submit]:before,
  331. input[type=reset]:before {
  332. content: attr(value);
  333. }
  334. input[type=file]:before {
  335. content: "Choose a file";
  336. }
  337. input[type=password][value]:before {
  338. font-family: "DejaVu Sans" !important;
  339. content: "\2022\2022\2022\2022\2022\2022\2022\2022";
  340. line-height: 1em;
  341. }
  342. input[type=checkbox],
  343. input[type=radio],
  344. select:after {
  345. font-family: "DejaVu Sans" !important;
  346. font-size: 18px;
  347. line-height: 1;
  348. }
  349. input[type=checkbox]:before {
  350. content: "\2610";
  351. }
  352. input[type=checkbox][checked]:before {
  353. content: "\2611";
  354. }
  355. input[type=radio]:before {
  356. content: "\25CB";
  357. }
  358. input[type=radio][checked]:before {
  359. content: "\25C9";
  360. }
  361. textarea {
  362. display: block;
  363. height: 3em;
  364. overflow: hidden;
  365. font-family: monospace;
  366. white-space: pre-wrap;
  367. word-wrap: break-word;
  368. }
  369. select {
  370. position: relative!important;
  371. overflow: hidden!important;
  372. }
  373. select:after {
  374. position: absolute;
  375. right: 0;
  376. top: 0;
  377. height: 5em;
  378. width: 1.4em;
  379. text-align: center;
  380. background: #CCC;
  381. content: "\25BE";
  382. }
  383. select option {
  384. display: none;
  385. }
  386. select option[selected] {
  387. display: inline;
  388. }
  389. fieldset {
  390. display: block;
  391. margin: 0.6em 2px 2px;
  392. padding: 0.75em;
  393. border: 1pt groove #666;
  394. position: relative;
  395. }
  396. fieldset > legend {
  397. position: absolute;
  398. top: -0.6em;
  399. left: 0.75em;
  400. padding: 0 0.3em;
  401. background: white;
  402. }
  403. legend {
  404. display: inline-block;
  405. }
  406. /* leafs */
  407. hr {
  408. display: block;
  409. height: 0;
  410. border: 1px inset;
  411. margin: 0.5em auto 0.5em auto;
  412. }
  413. hr[size="1"] {
  414. border-style: solid none none none;
  415. }
  416. iframe {
  417. border: 2px inset;
  418. }
  419. noframes {
  420. display: block;
  421. }
  422. br {
  423. display: -dompdf-br;
  424. }
  425. img, img_generated {
  426. display: -dompdf-image !important;
  427. }
  428. dompdf_generated {
  429. display: inline;
  430. }
  431. /* hidden elements */
  432. area, base, basefont, head, meta, script, style, title,
  433. noembed, param {
  434. display: none;
  435. -dompdf-keep: yes;
  436. }