Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using relative units in CSS #588

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/comment-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class CommentComponent {
}
this.element.innerHTML = `
<a class="avatar" href="${user.html_url}" target="_blank" tabindex="-1">
<img alt="@${user.login}" height="44" width="44"
<img alt="@${user.login}"
src="${user.avatar_url}${avatarArgs}">
</a>
<div class="comment">
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<main class="timeline">
<article class="timeline-comment">
<a class="avatar" href="https://github.com/utterance" tabindex="-1">
<img alt="@utterances" height="44" width="44"
<img alt="@utterances"
src="https://avatars3.githubusercontent.com/u/27908738?v=3&s=88">
</a>
<div class="comment">
Expand Down
14 changes: 7 additions & 7 deletions src/new-comment-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class NewCommentComponent {

this.element.innerHTML = `
<a class="avatar" target="_blank" tabindex="-1">
<img height="44" width="44">
<img>
</a>
<form class="comment" accept-charset="UTF-8" action="javascript:">
<header class="new-comment-header tabnav">
Expand All @@ -59,19 +59,19 @@ export class NewCommentComponent {
<footer class="new-comment-footer">
<a class="text-link markdown-info" tabindex="-1" target="_blank"
href="https://guides.github.com/features/mastering-markdown/">
<svg class="octicon v-align-bottom" viewBox="0 0 16 16" version="1.1"
width="16" height="16" aria-hidden="true">
<svg class="markdown-icon" class="octicon v-align-bottom" viewBox="0 0 16 16" version="1.1"
aria-hidden="true">
<path fill-rule="evenodd" d="M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15
13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4
8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z">
</path>
</svg>
Styling with Markdown is supported
<span>Styling with Markdown is supported</span>
</a>
<button class="btn btn-primary" type="submit">Comment</button>
<a class="btn btn-primary" href="${getLoginUrl(page.url)}" target="_top">
<svg class="octicon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>
Sign in with GitHub
<a class="btn btn-primary btn-sign-in" href="${getLoginUrl(page.url)}" target="_top">
<svg class="octicon github-icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>
<span>Sign in with GitHub</span>
</a>
</footer>
</form>`;
Expand Down
2 changes: 1 addition & 1 deletion src/reactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ export function getSignInToReactMenuHtml(align: 'center' | 'right') {
}

// tslint:disable-next-line:max-line-length
const addReactionSvgs = `<svg class="octicon" style="margin-right:3px" viewBox="0 0 7 16" version="1.1" width="7" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 4H3v3H0v1h3v3h1V8h3V7H4V4z"></path></svg><svg class="octicon" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm4.81 12.81a6.72 6.72 0 0 1-2.17 1.45c-.83.36-1.72.53-2.64.53-.92 0-1.81-.17-2.64-.53-.81-.34-1.55-.83-2.17-1.45a6.773 6.773 0 0 1-1.45-2.17A6.59 6.59 0 0 1 1.21 8c0-.92.17-1.81.53-2.64.34-.81.83-1.55 1.45-2.17.62-.62 1.36-1.11 2.17-1.45A6.59 6.59 0 0 1 8 1.21c.92 0 1.81.17 2.64.53.81.34 1.55.83 2.17 1.45.62.62 1.11 1.36 1.45 2.17.36.83.53 1.72.53 2.64 0 .92-.17 1.81-.53 2.64-.34.81-.83 1.55-1.45 2.17zM4 6.8v-.59c0-.66.53-1.19 1.2-1.19h.59c.66 0 1.19.53 1.19 1.19v.59c0 .67-.53 1.2-1.19 1.2H5.2C4.53 8 4 7.47 4 6.8zm5 0v-.59c0-.66.53-1.19 1.2-1.19h.59c.66 0 1.19.53 1.19 1.19v.59c0 .67-.53 1.2-1.19 1.2h-.59C9.53 8 9 7.47 9 6.8zm4 3.2c-.72 1.88-2.91 3-5 3s-4.28-1.13-5-3c-.14-.39.23-1 .66-1h8.59c.41 0 .89.61.75 1z"></path></svg>`;
const addReactionSvgs = `<svg class="octicon plus-icon" viewBox="0 0 7 16" version="1.1" aria-hidden="true"><path fill-rule="evenodd" d="M4 4H3v3H0v1h3v3h1V8h3V7H4V4z"></path></svg><svg class="octicon smile-icon" viewBox="0 0 16 16" version="1.1" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm4.81 12.81a6.72 6.72 0 0 1-2.17 1.45c-.83.36-1.72.53-2.64.53-.92 0-1.81-.17-2.64-.53-.81-.34-1.55-.83-2.17-1.45a6.773 6.773 0 0 1-1.45-2.17A6.59 6.59 0 0 1 1.21 8c0-.92.17-1.81.53-2.64.34-.81.83-1.55 1.45-2.17.62-.62 1.36-1.11 2.17-1.45A6.59 6.59 0 0 1 8 1.21c.92 0 1.81.17 2.64.53.81.34 1.55.83 2.17 1.45.62.62 1.11 1.36 1.45 2.17.36.83.53 1.72.53 2.64 0 .92-.17 1.81-.53 2.64-.34.81-.83 1.55-1.45 2.17zM4 6.8v-.59c0-.66.53-1.19 1.2-1.19h.59c.66 0 1.19.53 1.19 1.19v.59c0 .67-.53 1.2-1.19 1.2H5.2C4.53 8 4 7.47 4 6.8zm5 0v-.59c0-.66.53-1.19 1.2-1.19h.59c.66 0 1.19.53 1.19 1.19v.59c0 .67-.53 1.2-1.19 1.2h-.59C9.53 8 9 7.47 9 6.8zm4 3.2c-.72 1.88-2.91 3-5 3s-4.28-1.13-5-3c-.14-.39.23-1 .66-1h8.59c.41 0 .89.61.75 1z"></path></svg>`;
12 changes: 6 additions & 6 deletions src/stylesheets/email-fragment.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

.email-hidden-toggle a {
display: inline-block;
height: 12px;
padding: 0 9px;
font-size: 12px;
height: rem(12px);
padding: 0 rem(9px);
font-size: rem($font-size-small);
font-weight: 600;
line-height: 6px;
line-height: rem(6px);
color: $border-gray-darker;
text-decoration: none;
vertical-align: middle;
Expand All @@ -35,8 +35,8 @@

.email-quoted-reply,
.email-signature-reply {
padding: 0 15px;
margin: 15px 0;
padding: 0 rem(15px);
margin: rem(15px) 0;
color: $text-gray;
border-left: 4px solid $gray-200;
}
67 changes: 57 additions & 10 deletions src/stylesheets/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import "./scaling";
@import "@primer/css/base/index";
@import "@primer/css/buttons/button";
@import "@primer/css/forms/form-control";
Expand All @@ -9,38 +10,84 @@
@import "./timeline";
@import "./timeline-comment";

html {
font-size: $scaling * 100%;
}

body {
font-size: rem(14px);
}

.timeline {
width: 100%;
max-width: 760px;
max-width: rem(760px);
margin-left: auto;
margin-right: auto;
}

.markdown-body {
font-size: 16px;
font-size: rem(16px);
}

form {
font-size: $body-font-size;
font-size: rem($body-font-size);
}

fieldset {
border: none;
margin: 0 $spacer-3;
margin: 0 rem($spacer-3);
padding: 0;
}

input:not([type=radio]) {
margin: $spacer-1 0;
margin: rem($spacer-1) 0;
}

.form-checkbox {
label {
display: block;
cursor: pointer;

input {
margin: rem(5px) 0 0 rem(-20px) !important;
}
}

.note {
font-size: rem($font-size-small);
}
}

.form-checkbox label {
display: block;
cursor: pointer;
.config-field {
pre {
margin-bottom: 0;
}
}

.code-action {
float: right;
margin-top: -$spacer-2;
margin-bottom: $spacer-3;
margin-top: rem($spacer-2);
margin-bottom: rem($spacer-3);
}

.utterances {
max-width: 76rem;
}

.note {
font-size: rem($font-size-small);
}

.form-control, .form-select {
font-size: rem($body-font-size);
}

.form-select {
height: rem($size-5);
padding-right: rem($spacer-4);
padding: rem(5px) rem(12px);
font-size: rem(14px);
line-height: rem(20px);
background-position: right rem(8px) center;
background-size: rem(8px) rem(10px);
}
30 changes: 15 additions & 15 deletions src/stylesheets/permalink-code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@
}

.f6 {
font-size: 12px !important;
font-size: rem(12px) !important;
}

.my-2 {
margin-top: $spacer-2 !important;
margin-bottom: $spacer-2 !important;
margin-top: rem($spacer-2) !important;
margin-bottom: rem($spacer-2) !important;
}

.mb-0 {
margin-bottom: 0 !important;
}

.px-3 {
padding-right: $spacer-3 !important;
padding-left: $spacer-3 !important;
padding-right: rem($spacer-3) !important;
padding-left: rem($spacer-3) !important;
}

.py-0 {
Expand All @@ -44,12 +44,12 @@
}

.py-2 {
padding-top: $spacer-2 !important;
padding-bottom: $spacer-2 !important;
padding-top: rem($spacer-2) !important;
padding-bottom: rem($spacer-2) !important;
}

.blob-wrapper-embedded {
max-height: 240px;
max-height: rem(240px);
}

.blob-wrapper {
Expand All @@ -65,11 +65,11 @@

.blob-num {
width: 1%;
min-width: 50px;
padding-right: 10px;
padding-left: 10px;
min-width: rem(50px);
padding-right: rem(10px);
padding-left: rem(10px);
font-family: $mono-font;
font-size: $font-size-small;
font-size: rem($font-size-small);
line-height: $lh-default;
color: $black-fade-30;
text-align: right;
Expand All @@ -86,16 +86,16 @@
.blob-code-inner {
overflow: visible;
font-family: $mono-font;
font-size: $font-size-small;
font-size: rem($font-size-small);
color: $text-gray-dark;
word-wrap: normal;
white-space: pre;
}

.blob-code {
position: relative;
padding-right: 10px;
padding-left: 10px;
padding-right: rem(10px);
padding-left: rem(10px);
line-height: $lh-default;
vertical-align: top;
}
Expand Down
52 changes: 37 additions & 15 deletions src/stylesheets/reactions.scss
Original file line number Diff line number Diff line change
@@ -1,43 +1,62 @@
.reaction-list {
display: flex;
flex-wrap: nowrap;
margin-top: -1px;
margin-bottom: -1px;
margin-left: -1px;
border-right: $border;
overflow-x: hidden;
overflow-y: visible;
overflow: visible;
> .reaction-button:last-child {
border-right: none !important;
}
}

.reaction-list > .reaction-button {
font-weight: normal;
padding: $spacer-2 $spacer-3;
padding: rem($spacer-2) rem($spacer-3);
border-radius: 0 !important;
border-top: none;
border-bottom: none;

&:first-child {
border-left: $border;
border-bottom: $border;
margin-left: -1px;
margin-bottom: -1px;
}

&[reaction-count="0"] {
display: none;
}

&::after {
display: inline-block;
margin-left: 2px;
margin-left: rem(2px);
content: attr(reaction-count);
}
}

.reactions-popover {
summary {
margin: -1px 0;
padding: $spacer-2 $spacer-3;
height: 100%;
min-height: 3rem;
display: flex;
align-items: center;
color: $text-gray;
white-space: nowrap;
transition: opacity 0.3s ease-in-out;
padding: 0 rem($spacer-3);
&:hover {
color: $text-blue;
}

.plus-icon {
margin-right: rem(3px);
width: rem(7px);
height: rem(16px);
}

.smile-icon {
width: rem(16px);
height: rem(16px);
}
}

.Popover {
Expand All @@ -46,19 +65,22 @@

.Popover-message {
position: relative;
padding: $spacer-1;
padding: rem($spacer-1);
display: flex;
flex-wrap: wrap;
width: 150px;
width: rem(150px);
background-color: $bg-white;
border: $border;
border-radius: $border-radius;
}

.BtnGroup {
margin: 0 auto;
height: rem(28px);
display: flex;

&:first-of-type {
margin-top: $spacer-6;
margin-top: rem($spacer-6);
}
}

Expand All @@ -68,7 +90,7 @@
transition: transform 0.15s cubic-bezier(0.2, 0, 0.13, 2);
background: transparent !important;
white-space: nowrap;
padding: $spacer-1 $spacer-2;
padding: rem($spacer-1) rem($spacer-2);

&:hover {
transform: scale(1.2);
Expand All @@ -83,9 +105,9 @@
left: 0;
right: 0;
border-bottom: $border;
padding: $spacer-2 $spacer-3;
background-color: $bg-white;
padding: rem($spacer-2) rem($spacer-3);
pointer-events: none;
background-color: $bg-white;

.reaction-button + & {
display: none;
Expand Down
Loading