CARVIEW |
Select Language
HTTP/2 200
date: Wed, 30 Jul 2025 21:37:18 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-robots-tag: none
etag: W/"84241770cea530e5036e57588937f06a"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=pDUTbLxkg8%2FLxzLs9RD93I6Uiu2DK7YcktdOfArZgLSvv9MA0RpmZMo6t3bd5ATuDvOhAzxWzZVTdTgSKwhnVgmlreGO%2F4B2QNkboM%2Fd69M2P8l6ArAIBDJd2gkTdHehbiwrvUwNDf3k15u8SqKMFPwyuHEyf4s6mED3qiLLliKWQ6lIpuNQV2UJWw1PdaNZA3WkGYgJaPvDLTmDp5DeijW%2ByjVTkoUu%2BV3zLGmKxe%2FY%2BGEl3%2FTIOThpXv57TEsFd8V5g80KrZ9veYf2aGVi5g%3D%3D--eurxEMewTbVijchp--a7H7upgoSMRXS4Fp2W7hqw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.285037165.1753911438; Path=/; Domain=github.com; Expires=Thu, 30 Jul 2026 21:37:18 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 30 Jul 2026 21:37:18 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: CB46:1892F4:5634A:7BA87:688A908E
Adding styles · suntong/cascadia Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 11
Adding styles
suntong edited this page Sep 25, 2022
·
5 revisions
The way cascadia
adds styles to the html output is via the -y/--style
option string. The consideration behind such design is that the styles should be simple enough to be passed as a single string. Else, it is better to be put into a separated .css
and be included as css link.
The following are two ways of doing it, with the result of /tmp/out.html
for each case.
$ echo "$style"
<style>
body {background-color: powderblue;}
h1 {color: blue;}
p {color: red;}
</style>
$ cascadia -i /tmp/cascadia.xml -c 'input[name=Sex][value=F]' -o /tmp/out.html -w -y "$style"
1 elements for 'input[name=Sex][value=F]':
$ cat /tmp/out.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<base href="">
<style>
body {background-color: powderblue;}
h1 {color: blue;}
p {color: red;}
</style>
</head>
<body>
<input type="radio" name="Sex" value="F"/>
</body>
And here is a real-life example:
$ cascadia -o -i https://gaswizard.ca/gas-price-predictions/ -c ".gwgp-cities > tbody > tr:first-child, .gwgp-cities > tbody > tr:first-child + tr" -y "<style>.pd-down {color: #17cb46;} .pd-up {color: #ff0000;}</style>" -w | sed 's|<body>|&<table>|; s|</body>|</table>&|; s/⮟ *//' | tee /tmp/gas.html
$ cat /tmp/gas.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<base href="">
<style>.pd-down {color: #17cb46;} .pd-up {color: #ff0000;}</style>
</head>
<body><table>
<tr class="city">
<th class="gwgp-cityname">City</th>
<th class="gwgp-price">Regular</th>
<th class="gwgp-price">Premium</th>
<th class="gwgp-price">Diesel</th>
</tr>
<tr class="city">
<td class="gwgp-cityname">Toronto: </td>
<td class="gwgp-price">148.9 <span class="price-direction pd-down">-5</span></td>
<td class="gwgp-price">178.9 <span class="price-direction pd-down">-5</span></td>
<td class="gwgp-price">180.9 <span class="price-direction pd-down">-5</span></td>
</tr>
</table></body>
Check out its result here.
$ cascadia -i /tmp/cascadia.xml -c 'input[name=Sex][value=F]' -o /tmp/out.html -w -y '<link rel="stylesheet" href="styles.css">'
1 elements for 'input[name=Sex][value=F]':
$ cat /tmp/out.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<base href="">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<input type="radio" name="Sex" value="F"/>
</body>
For a real example produced by cascadia
using css link, take a look at this.
The -y/--style
option is not only for CSS styling. It's a fix-all option that you can put all kind of styling control into the header:
$ echo "$style"
<link rel="stylesheet" href="styles.css">
<script src="https://code.jquery.com/jquery-3.6.0.slim.min.js"></script>
<script src="myscripts.js"></script>
$ cascadia -i /tmp/cascadia.xml -c 'input[name=Sex][value=F]' -o /tmp/out.html -w -y "$style"
1 elements for 'input[name=Sex][value=F]':
$ cat /tmp/out.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<base href="">
<link rel="stylesheet" href="styles.css">
<script src="https://code.jquery.com/jquery-3.6.0.slim.min.js"></script>
<script src="myscripts.js"></script>
</head>
<body>
<input type="radio" name="Sex" value="F"/>
</body>
Clone this wiki locally
You can’t perform that action at this time.