Skip to content

Commit b660d56

Browse files
committed
Add syntax highlights
This really clashes visually with the colorization of the token parts (header, payload, signature). We need another fix for this.
1 parent 386c0c1 commit b660d56

File tree

4 files changed

+71
-20
lines changed

4 files changed

+71
-20
lines changed

src/Pages/Home/JwtDecoder/JwtDecoder.cshtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@
6363
<h4 class="pt-1">Payload</h4>
6464
<div id="jwt-payload" class="jwt-decoded jwt-payload bg-dark p-2">&nbsp;</div>
6565
<h4 class="pt-1">Signature</h4>
66-
<pre id="jwt-signature" class="jwt-decoded jwt-signature bg-dark p-2">&nbsp;</pre>
66+
<div class="jwt-decoded bg-dark p-2">
67+
<pre id="jwt-signature" class="jwt-signature">&nbsp;</pre>
68+
</div>
6769
<div class="jwt-signature-validation-result alert alert-success align-items-center d-none">
6870
<i class="glyphicon glyphicon-ok-sign" style="font-size: 3em" title="Valid signature"></i>
6971
<div class="result-message mx-3">This JWT has a valid signature.</div>

src/wwwroot/css/site.css

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,32 +114,54 @@ a.navbar-brand .icon-banner {
114114
.jwt-decoder-container .jwt-decoded {
115115
text-wrap: auto;
116116
background-color: #000000;
117+
color: #eee !important;
117118
}
118-
.jwt-decoder-container .jwt-decoded.jwt-header {
119-
color: rgb(253.5223880597, 157.4776119403, 157.4776119403);
119+
.jwt-decoder-container .jwt-decoded.jwt-header .json-content {
120+
background-color: rgba(252, 57, 57, 0.1882352941) !important;
120121
}
121-
.jwt-decoder-container .jwt-decoded.jwt-payload {
122-
color: #46ec88;
122+
.jwt-decoder-container .jwt-decoded.jwt-payload .json-content {
123+
background-color: rgba(19, 185, 85, 0.1882352941) !important;
123124
}
124-
.jwt-decoder-container .jwt-decoded.jwt-signature {
125-
color: rgb(245.7438016529, 201.7768595041, 124.2561983471);
125+
.jwt-decoder-container .jwt-decoded .jwt-signature {
126+
color: #eee !important;
127+
background-color: rgba(239, 163, 29, 0.1882352941);
128+
margin: 0;
126129
}
127130
.jwt-decoder-container .jwt-input-editable {
128131
word-wrap: anywhere;
129132
}
130133
.jwt-decoder-container .jwt-input-editable .text-danger {
131-
color: rgb(253.5223880597, 157.4776119403, 157.4776119403) !important;
134+
color: #eee !important;
135+
background-color: rgba(252, 57, 57, 0.1882352941);
132136
}
133137
.jwt-decoder-container .jwt-input-editable .text-success {
134-
color: #46ec88 !important;
138+
color: #eee !important;
139+
background-color: rgba(19, 185, 85, 0.1882352941);
135140
}
136141
.jwt-decoder-container .jwt-input-editable .text-warning {
137-
color: rgb(245.7438016529, 201.7768595041, 124.2561983471) !important;
142+
color: #eee !important;
143+
background-color: rgba(239, 163, 29, 0.1882352941);
138144
}
139145
.jwt-decoder-container .json-content, .jwt-decoder-container .jwt-input-editable {
140146
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
141147
font-size: 1em;
142148
}
149+
.jwt-decoder-container .json-content {
150+
color: #eee !important;
151+
}
152+
.jwt-decoder-container .json-content .json-key {
153+
color: goldenrod !important;
154+
}
155+
.jwt-decoder-container .json-content .json-boolean, .jwt-decoder-container .json-content .json-number {
156+
color: chocolate !important;
157+
}
158+
.jwt-decoder-container .json-content .json-string {
159+
color: darkcyan !important;
160+
}
161+
.jwt-decoder-container .json-content .json-explanation {
162+
color: springgreen !important;
163+
font-style: italic;
164+
}
143165
.jwt-decoder-container .jwt-signature {
144166
font-size: 1em;
145167
}

src/wwwroot/css/site.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/wwwroot/css/site.scss

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,33 +128,39 @@ a.navbar-brand {
128128
.jwt-decoded {
129129
text-wrap: auto;
130130
background-color: #000000;
131+
color: #eee !important;
131132

132-
&.jwt-header {
133-
color: lighten(#fc3939, 20%);
133+
&.jwt-header .json-content {
134+
background-color: #fc393930 !important;
134135
}
135136

136-
&.jwt-payload {
137-
color: lighten(#13b955, 20%);
137+
&.jwt-payload .json-content {
138+
background-color: #13b95530 !important;
138139
}
139140

140-
&.jwt-signature {
141-
color: lighten(#efa31d, 20%);
141+
.jwt-signature {
142+
color: #eee !important;
143+
background-color: #efa31d30;
144+
margin: 0;
142145
}
143146
}
144147

145148
.jwt-input-editable {
146149
word-wrap: anywhere;
147150

148151
.text-danger {
149-
color: lighten(#fc3939, 20%) !important;
152+
color: #eee !important;
153+
background-color: #fc393930;
150154
}
151155

152156
.text-success {
153-
color: lighten(#13b955, 20%) !important;
157+
color: #eee !important;
158+
background-color: #13b95530;
154159
}
155160

156161
.text-warning {
157-
color: lighten(#efa31d, 20%) !important;
162+
color: #eee !important;
163+
background-color: #efa31d30;
158164
}
159165
}
160166

@@ -163,6 +169,27 @@ a.navbar-brand {
163169
font-size: 1em;
164170
}
165171

172+
.json-content {
173+
color: #eee !important;
174+
175+
.json-key {
176+
color: goldenrod !important;
177+
}
178+
179+
.json-boolean, .json-number {
180+
color: chocolate !important;
181+
}
182+
183+
.json-string {
184+
color: darkcyan !important;
185+
}
186+
187+
.json-explanation {
188+
color: springgreen !important;
189+
font-style: italic;
190+
}
191+
}
192+
166193
.jwt-signature {
167194
font-size: 1em;
168195
}

0 commit comments

Comments
 (0)