Mercurial > p > roundup > code
view doc/_static/style.css @ 7362:527cad3a860c
color and full width example pre; change way to do max width
Color pre blocks light yellow so they stand out from background. The
white background wasn't enough contrast to make them scannable.
Also try to make pre blocks full bleed to the right to use all
available screen space without overflowing the screen. This makes
viewing, cut/paste etc. the examples easier. When pre extends past
edge of screen, pre will overflow and scrolling will kick in.
I still have an issue with pre inside tables. They cause the table to
overflow. Hence the page needs to be x-scrolled. I can change the
restructured text to insert a div/container and set the conteiner to
scroll on overflow, but I don't have another good answer at the moment.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 16 May 2023 19:37:13 -0400 |
| parents | ff5a50069822 |
| children | 8811f1934a79 |
line wrap: on
line source
/* layout*/ /* Set up fluid type scale. Major third for smaller screens and perfect fourth for larger screens. Allow override using --font-level-X. https://set.studio/some-simple-ways-to-make-content-look-good/ */ :root { --_font-level-0: var(--font-level-0, clamp(1rem, 0.96rem + 0.22vw, 1.13rem) ); --_font-level-1: var(--font-level-1, clamp( 1.25 * var(--_font-level-0), 1.16rem + 0.43vw, 1.5rem) ); --_font-level-2: var(--font-level-2, clamp( 1.25 * var(--_font-level-1), 1.41rem + 0.76vw, 2rem) ); --_font-level-3: var(--font-level-3, clamp( 1.25 * var(--_font-level-2), 1.71rem + 1.24vw, 2.66rem) ); --_font-level-4: var(--font-level-4, clamp( 1.25 * var(--_font-level-3), 2.05rem + 1.93vw, 3.55rem) ); } * + * { margin-block-start: 1.2em;} /* shrink spacing between list elements in tables of contents, badge displays */ div.toctree-wrapper * + *, div.contents * + *, div.release_info * { margin-block-start: 0.25em; } h1, h2, h3, h4, h5, h6 { line-height: 1.25; /* Larger spacing before header and smaller after to make header part of following section */ margin-block-end: 0.3em; } h1 { font-size: var(--_font-level-4); } /* remove whitespace at top of main column */ main h1 { margin-block-start: 0; } h2 { font-size: var(--_font-level-3); } h3 { font-size: var(--_font-level-2); } h4 { font-size: var(--_font-level-1); } /* snug header up to first paragraph of it's section. */ :is(h1,h2,h3,h4,h5,h6) + p { margin-block-start: 0; } body { background-color: #f5f5f5; color: rgb(20,20,20); font-family: sans-serif, Arial, Helvetica; font-size: var(--_font-level-0); margin:0; padding: 0 3em 0 14em; } /* -14em is size of table of contents/nav */ body > .header { margin: 0 0 0 -14em;} body > header > div.mobile { display:none; } body > .header div.label { font-size: 2em; font-weight: bold; margin: 0.67em 0 0.67em 1em;} body > .footer { margin: 1em 0 1em -14em; clear:both;} body > .navigation { margin-left: -14em; margin-inline-start: -14em; width: 14em; float: left; } body > .content { margin: 0; width: 100%; } body > .header > #searchbox { position: absolute; right: 1em; top: 1em;} body > .content > #subnav { position: absolute; right: 1.5em; top: 6em;} main { line-height: calc(1.5 * 1em); } /* limit width of items in main column to 65 characters. On wider screens can be 100+ chars: too wide */ main p, main:is(H1, H2, H3, H4, H5, H6), {max-width: 65ch;} main table { width: 65ch; } /* style */ :link { color: rgb(220,0,0); text-decoration: none;} :link:hover {text-decoration: underline;} :visited { color: rgb(187,0,0); text-decoration: none;} a.toc-backref { color: #000000; } .header h1 { margin-left: 1em; } .menu { padding: 0; margin-right: 1em;} .menu ul { padding: 0; margin: 0; } .menu li { margin: 5pt 0; } .menu > ul > li > * { display: block; padding: 2pt 2pt 2pt 10pt; border: solid thin #dadada; background-color:#ffffff; } .menu > ul > li.current > * { background-color:#dddddd; } .menu ul li:first-child { margin-top:0;} .menu ul { list-style-type:none;} /* sub-menus are indented */ .menu > ul > li > ul, .menu > ul > li.current > ul { border:none; background-color: inherit; } .menu ul ul { margin-left: 1em; font-size: smaller; } /* sub-menu items draw a separator */ .menu ul ul > li { margin: 0; padding: 0.5em; border: none; border-top: solid thin #dadada; background-color: inherit; } .menu ul ul > li:first-child { border-top: none; } .menu ul li.toctree-l2.current { background-color: #dddddd; pading-block: 0.25em; } /* related */ div.related { width: 100%; font-size: 90%; } div.related-top { border-bottom: solid thin #dadada;} div.related-bottom { border-top: solid thin #dadada;} div.related ul { margin: 0; padding: 0 0 0 10px; list-style: none; } div.related li { display: inline;} div.related li.right { float: right; margin-right: 5px; } .footer { font-size: small; text-align: center; color: black; } .footer img { vertical-align: middle; } .content { padding: 1em; border: solid thin #dadada; background-color: #f7f7f7; } /* This is a little hack to inject a 'news' block into the title page without having to set up a custom directive. */ #roundup-issue-tracker .note { float: right; width: auto; border: solid thin #dadada; background-color:#f5f5f5; padding: 1em; margin: 1em; } #roundup-issue-tracker .note .admonition-title { display: none; } table { border-collapse: collapse; border-spacing: 1px; background-color: #fafafa; } table:has(caption) { margin-block: 1em; } table caption { font-weight: bold; font-size: smaller; } table.footnote { font-size: calc(1em - 1pt); position: relative } table.footnote::before { border: 1px solid black; content: ""; left: 0; position: absolute; top: 0; width: 25%; } td { /* pull text away from borders */ padding-inline: 0.5em; } td > p { /* remove top margin on a p inside table cell so that columns with paragraphs align at top of cell rather than leaving a blank margin */ margin-block-start: 0px; } input, textarea { border-width: 1px; } a.headerlink { font-size: 0.8em; margin-left: 0.3em; color: #c99; } div.admonition { padding-inline: 1em; padding-block: 0.25em; border-inline-start: grey solid 4px; background-color: #dfdfdf; } div.admonition.caution { border-inline-start: red solid 4px; } div.admonition.warning { border-inline-start: yellow solid 4px; } p.admonition-title { border-block-end: grey solid 2px; font-weight: bold; font-size: larger; margin-block: 0; } div.admonition.caution p.admonition-title { border-block-end: red solid 2px; } dt { font-weight: bold; margin-block-start: 1em;} dt + dd { margin-block-start: 0.25em; } dd p.first { margin-block-start: 0; } dd > ul:first-child { /* reduce indent with list inside dd. I want to reduce margin-inline-start on dd but :has(> ul:first-child) doesn't work in firefox yet, so use negative margin on ul. */ margin-inline-start: -32px; } #skiplink { display: block; margin-block-start: 1em; margin-inline-start: 1em;} #skiplink a { /* force stuff for screenreader off screen */ position:absolute; left:-10000px; top:auto; width:1px; height:1px; overflow:hidden; padding: 0 0.75em; font-weight: bold; } #skiplink a:focus { position: static; width: auto; height: auto; } /* remove solid black border when focus is around the main section due to activation of skip-link. Page jumps there, that's enough. */ #main:focus-visible {outline: none;} /* Prevent examples from extending outside the viewport */ /*div.highlight > pre { overflow-wrap: anywhere; white-space: break-spaces; }*/ /* Forcing wrap in a pre leads to some confusing line breaks. Use a horizontal scroll. Indicate the scroll by using rounded scroll shadows. https://css-tricks.com/books/greatest-css-tricks/scroll-shadows/ https://blogit.create.pt/pedrolopes/2022/03/24/css-scroll-shadows/ */ div.highlight > pre { overflow-wrap: normal; overflow-x: auto; /* Shadows */ background-image: /* Shadow covers */ linear-gradient(to right, #f5f4d8, #f5f4d8), linear-gradient(to right, #f5f4d8, #f5f4d8), /* Shadow */ radial-gradient(farthest-side at 0px 50%, rgba(0, 0, 20, 0.5), rgba(255, 255, 255, 0)), radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 20, 0.5), rgba(255, 255, 255, 0)); /* square shadows */ /* linear-gradient(to right, rgba(0, 0, 0, 0.25), rgba(255, 255, 255, 0)), linear-gradient(to left, rgba(0, 0, 0, 0.25), rgba(255, 255, 255, 0)); */ background-position: left center, right center, left center, right center; background-repeat: no-repeat; background-color: #f5f4d8; background-size: 20px 100%, 20px 100%, 16px 100%, 16px 100%; background-attachment: local, local, scroll, scroll; }
