|
| 1 | +// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file |
| 2 | +// for details. All rights reserved. Use of this source code is governed by a |
| 3 | +// BSD-style license that can be found in the LICENSE file. |
| 4 | + |
| 5 | +const dartPageStyle = r''' |
| 6 | +body { |
| 7 | + background-color: black; |
| 8 | + color: white; |
| 9 | + font-family: 'Open Sans', sans-serif; |
| 10 | + /* This allows very small files to be displayed lower than the very top of the |
| 11 | + * screen. |
| 12 | + */ |
| 13 | + margin-bottom; 100px; |
| 14 | + padding: 0.5em; |
| 15 | +} |
| 16 | +
|
| 17 | +h1 { |
| 18 | + font-size: 2.4em; |
| 19 | + font-weight: 600; |
| 20 | + margin: 0; |
| 21 | +} |
| 22 | +
|
| 23 | +h2 { |
| 24 | + font-size: 1.2em; |
| 25 | + font-weight: 600; |
| 26 | + margin: 0; |
| 27 | +} |
| 28 | +
|
| 29 | +.horizontal { |
| 30 | + display: flex; |
| 31 | + flex-wrap: wrap-reverse; |
| 32 | +} |
| 33 | +
|
| 34 | +.content { |
| 35 | + flex: 1; |
| 36 | + font-family: monospace; |
| 37 | + /* Vertical margin around content. */ |
| 38 | + margin: 10px 0; |
| 39 | + /* Offset the margin introduced by the absolutely positioned child div. */ |
| 40 | + margin-left: -0.5em; |
| 41 | + min-width: 900px; |
| 42 | + position: relative; |
| 43 | + white-space: pre; |
| 44 | +} |
| 45 | +
|
| 46 | +.code { |
| 47 | + left: 0.5em; |
| 48 | + /* Increase line height to make room for borders in non-nullable type |
| 49 | + * regions. |
| 50 | + */ |
| 51 | + line-height: 1.3; |
| 52 | + padding-left: 60px; |
| 53 | + position: inherit; |
| 54 | +} |
| 55 | +
|
| 56 | +.code a:link { |
| 57 | + color: inherit; |
| 58 | + text-decoration-line: none; |
| 59 | +} |
| 60 | +
|
| 61 | +.code a:visited { |
| 62 | + color: inherit; |
| 63 | + text-decoration-line: none; |
| 64 | +} |
| 65 | +
|
| 66 | +.code a:hover { |
| 67 | + text-decoration-line: underline; |
| 68 | + font-weight: 600; |
| 69 | +} |
| 70 | +
|
| 71 | +.regions { |
| 72 | + padding: 0.5em; |
| 73 | + position: absolute; |
| 74 | + left: 0.5em; |
| 75 | + top: 0; |
| 76 | + /* The content of the regions is not visible; the user instead will see the |
| 77 | + * highlighted copy of the content. */ |
| 78 | + visibility: hidden; |
| 79 | +} |
| 80 | +
|
| 81 | +.regions table { |
| 82 | + border-spacing: 0; |
| 83 | +} |
| 84 | +
|
| 85 | +.regions td { |
| 86 | + border: none; |
| 87 | + line-height: 1.3; |
| 88 | + padding: 0; |
| 89 | + white-space: pre; |
| 90 | +} |
| 91 | +
|
| 92 | +.regions td:empty:after { |
| 93 | + content: "\00a0"; |
| 94 | +} |
| 95 | +
|
| 96 | +.regions td.line-no { |
| 97 | + color: #999999; |
| 98 | + display: inline-block; |
| 99 | + padding-right: 4px; |
| 100 | + text-align: right; |
| 101 | + visibility: visible; |
| 102 | + width: 50px; |
| 103 | +} |
| 104 | +
|
| 105 | +.region { |
| 106 | + cursor: default; |
| 107 | + display: inline-block; |
| 108 | + position: relative; |
| 109 | + visibility: visible; |
| 110 | +} |
| 111 | +
|
| 112 | +.region.fix-region { |
| 113 | + /* Green means this region was added. */ |
| 114 | + background-color: #ccffcc; |
| 115 | + color: #003300; |
| 116 | +} |
| 117 | +
|
| 118 | +.region.non-nullable-type-region { |
| 119 | + background-color: rgba(0, 0, 0, 0.3); |
| 120 | + border-bottom: solid 2px #cccccc; |
| 121 | + /* Invisible text; use underlying highlighting. */ |
| 122 | + color: rgba(0, 0, 0, 0); |
| 123 | + /* Reduce line height to make room for border. */ |
| 124 | + line-height: 1; |
| 125 | +} |
| 126 | +
|
| 127 | +.region .tooltip { |
| 128 | + background-color: #EEE; |
| 129 | + border: solid 2px #999; |
| 130 | + color: #333; |
| 131 | + cursor: auto; |
| 132 | + font-family: sans-serif; |
| 133 | + font-size: 0.8em; |
| 134 | + left: 0; |
| 135 | + margin-left: 0; |
| 136 | + opacity: 0%; |
| 137 | + padding: 1px; |
| 138 | + position: absolute; |
| 139 | + top: 100%; |
| 140 | + transition: visibility 0s linear 500ms, opacity 200ms ease 300ms; |
| 141 | + visibility: hidden; |
| 142 | + white-space: normal; |
| 143 | + width: 400px; |
| 144 | + z-index: 1; |
| 145 | +} |
| 146 | +
|
| 147 | +.region .tooltip > * { |
| 148 | + margin: 1em; |
| 149 | +} |
| 150 | +
|
| 151 | +.region:hover .tooltip { |
| 152 | + opacity: 100%; |
| 153 | + transition: opacity 150ms; |
| 154 | + visibility: visible; |
| 155 | +} |
| 156 | +
|
| 157 | +.nav { |
| 158 | + background-color: #282b2e; |
| 159 | + flex-basis: 0; |
| 160 | + flex-grow: 1; |
| 161 | + font-size: 14px; |
| 162 | + /* 10px to match exact top margin of .content. |
| 163 | + * 0.8em to pair with the -0.5em margin of .content, producing a net margin |
| 164 | + * between the two of 0.3em. |
| 165 | + */ |
| 166 | + margin: 10px 0.8em; |
| 167 | + padding: 0.5em; |
| 168 | +} |
| 169 | +
|
| 170 | +.nav :first-child { |
| 171 | + margin-top: 0; |
| 172 | +} |
| 173 | +
|
| 174 | +.nav .root { |
| 175 | + margin: 0; |
| 176 | +} |
| 177 | +
|
| 178 | +.nav .file-name { |
| 179 | + margin-left: 1em; |
| 180 | +} |
| 181 | +
|
| 182 | +.nav a:link { |
| 183 | + color: #33ccff; |
| 184 | +} |
| 185 | +
|
| 186 | +.nav a:visited { |
| 187 | + color: #33ccff; |
| 188 | +} |
| 189 | +
|
| 190 | +.nav .selected-file { |
| 191 | + font-weight: 600; |
| 192 | +} |
| 193 | +
|
| 194 | +.target { |
| 195 | + background-color: #FFFF99; |
| 196 | + position: relative; |
| 197 | + visibility: visible; |
| 198 | +} |
| 199 | +'''; |
0 commit comments