custom-block.styl 7.9 KB
Newer Older
M
mehaotian 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329
/**
 * Colors Base
 *
 * These are the pure base color presets. Most of the time, you should not be
 * using these colors directly in the theme but rather use "Colors Theme"
 * instead because those are "Theme (light or dark)" dependant.
 * -------------------------------------------------------------------------- */

:root {
  --vt-c-white: #ffffff;
  --vt-c-white-soft: #f9f9f9;
  --vt-c-white-mute: #f1f1f1;

  --vt-c-black: #1a1a1a;
  --vt-c-black-pure: #000000;
  --vt-c-black-soft: #242424;
  --vt-c-black-mute: #2f2f2f;

  --vt-c-indigo: #213547;
  --vt-c-indigo-soft: #476582;
  --vt-c-indigo-light: #aac8e4;

  --vt-c-gray: #8e8e8e;
  --vt-c-gray-light-1: #aeaeae;
  --vt-c-gray-light-2: #c7c7c7;
  --vt-c-gray-light-3: #d1d1d1;
  --vt-c-gray-light-4: #e5e5e5;
  --vt-c-gray-light-5: #f2f2f2;
  --vt-c-gray-dark-1: #636363;
  --vt-c-gray-dark-2: #484848;
  --vt-c-gray-dark-3: #3a3a3a;
  --vt-c-gray-dark-4: #282828;
  --vt-c-gray-dark-5: #202020;

  --vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
  --vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
  --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
  --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);

  --vt-c-text-light-1: var(--vt-c-indigo);
  --vt-c-text-light-2: rgba(60, 60, 60, 0.70);
  --vt-c-text-light-3: rgba(60, 60, 60, 0.33);
  --vt-c-text-light-4: rgba(60, 60, 60, 0.18);
  --vt-c-text-light-code: var(--vt-c-indigo-soft);

  --vt-c-text-dark-1: rgba(255, 255, 255, 0.87);
  --vt-c-text-dark-2: rgba(235, 235, 235, 0.60);
  --vt-c-text-dark-3: rgba(235, 235, 235, 0.38);
  --vt-c-text-dark-4: rgba(235, 235, 235, 0.18);
  --vt-c-text-dark-code: var(--vt-c-indigo-light);

  --vt-c-green: #42b883;
  --vt-c-green-light: #42d392;
  --vt-c-green-lighter: #35eb9a;
  --vt-c-green-dark: #33a06f;
  --vt-c-green-darker: #155f3e;

  --vt-c-blue: #3b8eed;
  --vt-c-blue-light: #549ced;
  --vt-c-blue-lighter: #50a2ff;
  --vt-c-blue-dark: #3468a3;
  --vt-c-blue-darker: #255489;

  --vt-c-yellow: #ffc517;
  --vt-c-yellow-light: #ffe417;
  --vt-c-yellow-lighter: #ffff17;
  --vt-c-yellow-dark: #e0ad15;
  --vt-c-yellow-darker: #bc9112;

  --vt-c-red: #ed3c50;
  --vt-c-red-light: #f43771;
  --vt-c-red-lighter: #fd1d7c;
  --vt-c-red-dark: #cd2d3f;
  --vt-c-red-darker: #ab2131;

  --vt-c-purple: #de41e0;
  --vt-c-purple-light: #e936eb;
  --vt-c-purple-lighter: #f616f8;
  --vt-c-purple-dark: #823c83;
  --vt-c-purple-darker: #602960;
}

/**
 * Colors Theme
 * -------------------------------------------------------------------------- */

:root {
  --vt-c-bg: var(--vt-c-white);
  --vt-c-bg-soft: var(--vt-c-white-soft);
  --vt-c-bg-mute: var(--vt-c-white-mute);

  --vt-c-divider: var(--vt-c-divider-light-1);
  --vt-c-divider-light: var(--vt-c-divider-light-2);

  --vt-c-divider-inverse: var(--vt-c-divider-dark-1);
  --vt-c-divider-inverse-light: var(--vt-c-divider-dark-2);

  --vt-c-text-1: var(--vt-c-text-light-1);
  --vt-c-text-2: var(--vt-c-text-light-2);
  --vt-c-text-3: var(--vt-c-text-light-3);
  --vt-c-text-4: var(--vt-c-text-light-4);
  --vt-c-text-code: var(--vt-c-text-light-code);

  --vt-c-text-inverse-1: var(--vt-c-text-dark-1);
  --vt-c-text-inverse-2: var(--vt-c-text-dark-2);
  --vt-c-text-inverse-3: var(--vt-c-text-dark-3);
  --vt-c-text-inverse-4: var(--vt-c-text-dark-4);

  --vt-c-brand: var(--vt-c-green);
  --vt-c-brand-light: var(--vt-c-green-light);
  --vt-c-brand-dark: var(--vt-c-green-dark);
  --vt-c-brand-highlight: var(--vt-c-brand-dark);
}

.dark {
  --vt-c-bg: var(--vt-c-black);
  --vt-c-bg-soft: var(--vt-c-black-soft);
  --vt-c-bg-mute: var(--vt-c-black-mute);

  --vt-c-divider: var(--vt-c-divider-dark-1);
  --vt-c-divider-light: var(--vt-c-divider-dark-2);

  --vt-c-divider-inverse: var(--vt-c-divider-light-1);
  --vt-c-divider-inverse-light: var(--vt-c-divider-light-2);

  --vt-c-text-1: var(--vt-c-text-dark-1);
  --vt-c-text-2: var(--vt-c-text-dark-2);
  --vt-c-text-3: var(--vt-c-text-dark-3);
  --vt-c-text-4: var(--vt-c-text-dark-4);
  --vt-c-text-code: var(--vt-c-text-dark-code);

  --vt-c-text-inverse-1: var(--vt-c-text-light-1);
  --vt-c-text-inverse-2: var(--vt-c-text-light-2);
  --vt-c-text-inverse-3: var(--vt-c-text-light-3);
  --vt-c-text-inverse-4: var(--vt-c-text-light-4);

  --vt-c-brand-highlight: var(--vt-c-brand-light);
}

/**
 * Typography
 * -------------------------------------------------------------------------- */

:root {
  --vt-font-family-base: Inter, -apple-system,
    BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
    'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  --vt-font-family-mono: Menlo, Monaco, Consolas, 'Courier New', monospace;
}

/**
 * Shadows
 * -------------------------------------------------------------------------- */

:root {
  --vt-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --vt-shadow-2: 0 3px 12px rgba(0, 0, 0, 0.07), 0 1px 4px rgba(0, 0, 0, 0.07);
  --vt-shadow-3: 0 12px 32px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.08);
  --vt-shadow-4: 0 14px 44px rgba(0, 0, 0, 0.12), 0 3px 9px rgba(0, 0, 0, 0.12);
  --vt-shadow-5: 0 18px 56px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.16);
}

/**
 * Magic Numbers
 * -------------------------------------------------------------------------- */

:root {
  --vt-nav-height: 55px;
}

.custom-block .custom-block-title {
	margin-top 0
	font-weight 600
	margin-bottom -0.4rem
}

.custom-block.tip,.custom-block.warning,.custom-block.danger,.custom-block.details {
	padding 20px 24px 4px 50px
	border-left-width .5rem
	border-left-style solid
	margin 1rem 0
}

.custom-block.tip {
	color: rgba(0, 0, 0, 0.55);
	border-color #42b983
}
.custom-block.warning {
	background-color rgba(255,229,100,.3)
	background-color: var(--vt-c-bg-soft);
	color: rgba(0, 0, 0, 0.55);
}

.custom-block.warning .custom-block-title  {
	color: var(--vt-c-text-1);
}

.custom-block.warning a{
	color $textColor
}

.custom-block.danger {
	background-color: var(--vt-c-bg-soft);
	border-color darken(red, 20%)
	color: rgba(0, 0, 0, 0.55);
}

.custom-block.danger .custom-block-title  {
	color: var(--vt-c-text-1);
}

.custom-block.danger a{
	color $textColor
}

.custom-block.details {
	display block
	position relative
	border-radius 2px
	margin 1.6em 0
	background-color: var(--vt-c-bg-soft);
}

.custom-block.details h4 {
	margin-top 0
}

.custom-block.details figure:last-child{
	  margin-bottom 0
	  padding-bottom 0
}

.custom-block.details p:last-child{
	  margin-bottom 0
	  padding-bottom 0
}
      
.custom-block.details summary {
	outline none
	cursor pointer
	margin-bottom 1.0em
}
     
.custom-block {
  margin: 28px 0;
  padding: 20px 24px 4px 50px;
  border-radius: 8px;
  overflow-x: auto;
  transition: color 0.5s, background-color 0.5s;
  position: relative;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.55);
  background-color: var(--vt-c-bg-soft);
}

.dark .custom-block {
  color: var(--vt-c-text-2);
}

.custom-block:before {
  content: 'ⓘ';
  position: absolute;
  font-weight: 600;
  font-size: 15px;
  top: 20px;
  left: 17px;
}

.custom-block.warning:before,
.custom-block.danger:before {
  content: '⚠';
  font-size: 17px;
  top: 19px;
  left: 16ppx;
}

.custom-block .custom-block-title {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--vt-c-text-1);
  transition: color 0.5s;
}

.custom-block.tip {
  border: 1px solid var(--vt-c-brand);
}
.custom-block.tip:before {
  color: var(--vt-c-brand);
}

.custom-block.warning {
  border: 1px solid var(--vt-c-yellow);
}
.custom-block.warning:before {
  color: var(--vt-c-yellow);
}

.custom-block.danger {
  border: 1px solid var(--vt-c-red);
}
.custom-block.danger .custom-block-title,
.custom-block.danger:before {
  color: var(--vt-c-red);
}

.custom-block ul li:before {
  top: 0.55rem;
}
.custom-block ol li:before {
  top: 1px;
  font-size: 13px;
}

.custom-block :not(pre) > code {
  font-size: 13px;
  background-color: rgba(27, 31, 35, 0.05);
}

.dark .custom-block :not(pre) > code {
  background-color: rgba(0, 0, 0, 0.2);
}

.custom-block.danger a,
.custom-block.warning a {
  color: var(--vt-c-text-code);
}