forked from nus-cs2103-AY2223S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #513 from RichDom2185/week13/style-ppp-pr-badge
Add and style PR badge for PPP
- Loading branch information
Showing
10 changed files
with
301 additions
and
182 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% comment %} | ||
Copyright 2022 Richard Dominick | ||
{% endcomment %} | ||
{% capture newline %} | ||
{% endcapture %} | ||
{%- assign nodes = include.html | ||
| strip | ||
| split: '[[' | ||
-%} | ||
{{ nodes.first }} | ||
{%- for node in nodes offset:1 -%} | ||
{% assign data = node | split: ']]' %}{% assign tag = data | first | strip | split: '#' %}{% assign type = tag | first | strip %}{% assign number = tag | last | strip %} | ||
{%- if type == 'PR' -%} | ||
<span class="pr-badge"> | ||
{% include icons/git-merge.svg class="icon" %} | ||
<a href="https://github.com/{{ site.repository }}/pull/{{ number }}">PR#{{ number }}</a> | ||
<span class="tooltip"><strong>Pull Request</strong> #{{ number }}<br><small>View on GitHub</small></span> | ||
</span> | ||
{%- for tail in data offset:1 -%} | ||
{{ tail }} | ||
{%- endfor -%} | ||
{%-else -%} | ||
[[{{ node }} | ||
{%- endif -%} | ||
{%- endfor -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
--- | ||
layout: page | ||
--- | ||
{{ content }} | ||
{% include ppp-badges.liquid html=content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
.pr-badge { | ||
$color: #8250df; | ||
$border-color: #d0d7de; | ||
|
||
vertical-align: text-bottom; | ||
|
||
display: inline-flex; | ||
column-gap: 4px; | ||
align-items: center; | ||
|
||
background-color: #f8f8f8; | ||
border-radius: 3px; | ||
border: 1px solid $border-color; | ||
|
||
margin-inline: 2px; | ||
padding: 2px 4px; | ||
|
||
> a { | ||
display: inline-block; | ||
color: inherit !important; | ||
line-height: 100%; | ||
font-weight: bold; | ||
font-size: 0.75em; | ||
text-decoration: none; | ||
} | ||
|
||
&:hover > a { | ||
color: $link-base-color !important; | ||
} | ||
|
||
.icon { | ||
$size: 14px; | ||
fill: $color; | ||
vertical-align: text-top; | ||
display: inline-block; | ||
height: $size; | ||
width: $size; | ||
} | ||
|
||
position: relative; | ||
|
||
> .tooltip { | ||
-webkit-user-select: none; | ||
-moz-user-select: none; | ||
-ms-user-select: none; | ||
user-select: none; | ||
|
||
border: 1px solid $border-color; | ||
|
||
$width: 180px; | ||
width: $width; | ||
margin-left: calc(-#{$width} / 2); | ||
box-sizing: border-box; | ||
padding: 6px 10px; | ||
|
||
background-color: white; | ||
border-radius: 6px; | ||
color: gray; | ||
font-size: small; | ||
|
||
position: absolute; | ||
bottom: 150%; | ||
left: 50%; | ||
text-align: center; | ||
|
||
strong { | ||
color: black; | ||
} | ||
|
||
// Popup arrow | ||
&::after { | ||
$arrow-width: 5px; | ||
content: ""; | ||
position: absolute; | ||
top: 100%; | ||
left: 50%; | ||
margin-left: -$arrow-width; | ||
border-width: $arrow-width; | ||
border-style: solid; | ||
border-color: $border-color transparent transparent transparent; | ||
} | ||
|
||
:last-child { | ||
font-size: smaller; | ||
} | ||
|
||
visibility: hidden; | ||
opacity: 0; | ||
transition: opacity ease-in-out 150ms; | ||
|
||
@media screen and (prefers-reduced-motion: reduce) { | ||
transition: none; | ||
} | ||
} | ||
|
||
&:hover > .tooltip { | ||
opacity: 1; | ||
visibility: visible; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
"foodrem", | ||
"admonitions", | ||
"toc", | ||
"ppp", | ||
"pdf"; | ||
|
||
.icon { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.