Skip to content

Commit

Permalink
Rotate threat model headers 45 degrees instead of 90.
Browse files Browse the repository at this point in the history
  • Loading branch information
jyasskin committed Jun 1, 2020
1 parent 2565a3c commit 64c7fff
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 12 deletions.
38 changes: 32 additions & 6 deletions index.bs
Expand Up @@ -42,15 +42,41 @@ spec: PSL; urlPrefix: https://publicsuffix.org/
<pre class='link-defaults'>
</pre>
<style>
.threatmodel tr.goals th {
padding: 1ex;
max-height: 20em;
}
.threatmodel tr.goals th * {
writing-mode: vertical-rl;
@supports(transform: rotate(45deg)) {
/* Rotate threat model table headers to fit more columns on the screen.
* Details adapted from
* https://wabain.github.io/2019/10/13/css-rotated-table-header.html */
.threatmodel tr.goals th {
/* sin(45deg) == 0.707 */
height: calc((25em + 3em) * 0.707);
vertical-align: bottom;
text-align: right;
line-height: 1;
}
.threatmodel tr.goals th > div {
width: 5em;
}
.threatmodel tr.goals th > div > div {
width: 25em;
transform-origin: bottom left;
/* Read the transform steps bottom-up. */
transform:
/* Move the bottom corner from the left edge of the column to the center. */
translateX(calc(5em/2))
/* Rotate 45 degrees clockwise. */
rotate(45deg)
/* Move the bottom-right corner to the left edge of the column, which is
* the transform-origin. */
translateX(-100%);
}
.threatmodel tr.goals th a[href] {
border-bottom: 0;
}
}

.threatmodel td {
text-align: center;
min-width: 2em;
}
details[open] {
position: absolute;
Expand Down
12 changes: 6 additions & 6 deletions xsite-tracking-model.bsinc
Expand Up @@ -3,11 +3,11 @@
<table class="threatmodel">
<tr class="goals">
<td></td>
<th>[[#goal-transfer-userid]]</th>
<th>[[#goal-userid-tracker-to-self-in-pub]]</th>
<th>[[#goal-userid-tracker-in-pub1-to-self-in-pub2]]</th>
<th>[[#goal-prob-transfer-userid-no-nav]]</th>
<th>[[#goal-prob-transfer-userid]]</th>
<th><div><div>[[#goal-transfer-userid]]</div></div></th>
<th><div><div>[[#goal-userid-tracker-to-self-in-pub]]</div></div></th>
<th><div><div>[[#goal-userid-tracker-in-pub1-to-self-in-pub2]]</div></div></th>
<th><div><div>[[#goal-prob-transfer-userid-no-nav]]</div></div></th>
<th><div><div>[[#goal-prob-transfer-userid]]</div></div></th>
</tr>
<tr>
<th>[[#cap-iframes]]</th>
Expand Down Expand Up @@ -111,7 +111,7 @@ attacker-controlled javascript):
<table class="threatmodel">
<tr class="goals">
<td></td>
<th>[[#goal-prob-transfer-userid-no-nav]]</th>
<th><div><div>[[#goal-prob-transfer-userid-no-nav]]</div></div></th>
</tr>
<tr>
<th>[[#cap-type-identifier]]</th>
Expand Down

0 comments on commit 64c7fff

Please sign in to comment.