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

add theme: nella-red (previous PR closed) #422

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
3,387 changes: 3,387 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,25 @@
"start": "parcel serve src/*.html src/client.ts src/stylesheets/themes/*/{index,utterances}.scss --no-hmr --port 4000",
"build": "parcel build src/*.html src/client.ts src/stylesheets/themes/*/{index,utterances}.scss --experimental-scope-hoisting",
"lint": "tslint --project tsconfig.json",
"predeploy": "yarn run build && touch dist/.nojekyll && echo 'utteranc.es' > dist/CNAME",
"predeploy": "yarn run build && touch dist/.nojekyll && echo 'utterances.allenfrostline.com' > dist/CNAME",
"deploy": "gh-pages --dist dist"
},
"devDependencies": {
"@primer/css": "^14.2.0",
"autoprefixer": "^9.7.4",
"cssnano": "^4.1.10",
"gh-pages": "^2.2.0",
"github-syntax-dark": "^0.5.0",
"github-syntax-light": "^0.5.0",
"parcel-bundler": "^1.12.4",
"parcel-plugin-clean-dist": "^0.0.6",
"posthtml-expressions": "^1.2.0",
"posthtml-include": "^1.4.0",
"posthtml-md": "^1.1.0",
"sass": "^1.26.3",
"tslint": "^6.1.0",
"typescript": "^3.8.3"
},
"dependencies": {
"cfworker": "git+https://github.com/cfworker/cfworker.git"
}
}
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let script = document.currentScript as HTMLScriptElement;
if (script === undefined) {
// Internet Explorer :(
// tslint:disable-next-line:max-line-length
script = document.querySelector('script[src^="https://utteranc.es/client.js"],script[src^="http://localhost:4000/client.js"]') as HTMLScriptElement;
script = document.querySelector('script[src^="https://utterances.allenfrostline.com/client.js"],script[src^="http://localhost:4000/client.js"]') as HTMLScriptElement;
}

// gather script element's attributes
Expand Down Expand Up @@ -76,7 +76,7 @@ document.head.insertAdjacentHTML(
</style>`);

// create the comments iframe and it's responsive container
const utterancesOrigin = script.src.match(/^https:\/\/utteranc\.es|http:\/\/localhost:\d+/)![0];
const utterancesOrigin = script.src.match(/^https:\/\/utterances\.allenfrostline.com|http:\/\/localhost:\d+/)![0];
const url = `${utterancesOrigin}/utterances.html`;
script.insertAdjacentHTML(
'afterend',
Expand Down
3 changes: 2 additions & 1 deletion src/configuration-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export class ConfigurationComponent {
<option value="dark-blue">Dark Blue</option>
<option value="photon-dark">Photon Dark</option>
<option value="boxy-light">Boxy Light</option>
<option value="nella-red">Nella Red</option>
</select>

<h3 id="heading-enable">Enable Utterances</h3>
Expand Down Expand Up @@ -212,7 +213,7 @@ export class ConfigurationComponent {

private makeConfigScript(attrs: string) {
// tslint:disable-next-line:max-line-length
return `<pre><span class="pl-s1">&lt;<span class="pl-ent">script</span> <span class="pl-e">src</span>=<span class="pl-s"><span class="pl-pds">"</span>https://utteranc.es/client.js<span class="pl-pds">"</span></span></span>\n${attrs}\n<span class="pl-s1"> <span class="pl-e">async</span>&gt;</span>\n<span class="pl-s1">&lt;/<span class="pl-ent">script</span>&gt;</span></pre>`;
return `<pre><span class="pl-s1">&lt;<span class="pl-ent">script</span> <span class="pl-e">src</span>=<span class="pl-s"><span class="pl-pds">"</span>https://utterances.allenfrostline.com/client.js<span class="pl-pds">"</span></span></span>\n${attrs}\n<span class="pl-s1"> <span class="pl-e">async</span>&gt;</span>\n<span class="pl-s1">&lt;/<span class="pl-ent">script</span>&gt;</span></pre>`;
}

private copyTextToClipboard(text: string) {
Expand Down
16 changes: 8 additions & 8 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<link rel="preconnect" href="https://api.github.com">
<link rel="preconnect" href="https://avatars3.githubusercontent.com">
<if condition="NODE_ENV === 'production'">
<link id="theme-stylesheet" rel="stylesheet" href="https://utteranc.es/stylesheets/themes/github-light/index.css">
<link id="theme-stylesheet" rel="stylesheet" href="https://utterances.allenfrostline.com/stylesheets/themes/nella-red/index.css">
</if>
<else>
<link id="theme-stylesheet" rel="stylesheet" href="http://localhost:4000/stylesheets/themes/github-light/index.css">
<link id="theme-stylesheet" rel="stylesheet" href="http://localhost:4000/stylesheets/themes/nella-red/index.css">
</else>
<link rel="apple-touch-icon" sizes="180x180" href="./icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./icons/favicon-32x32.png">
Expand All @@ -20,7 +20,7 @@
<link rel="mask-icon" href="./icons/safari-pinned-tab.svg" color="#4c2889">
<link rel="shortcut icon" href="./icons/favicon.ico">
<if condition="NODE_ENV === 'production'">
<link rel="canonical" href="https://utteranc.es">
<link rel="canonical" href="https://utterances.allenfrostline.com">
</if>
<else>
<link rel="canonical" href="http://localhost:4000/index.html">
Expand Down Expand Up @@ -67,11 +67,11 @@
<script src="./index.ts"></script>

<if condition="NODE_ENV === 'production'">
<script src="https://utteranc.es/client.js"
repo="utterance/utterances"
issue-term="homepage"
<script src="https://utterances.allenfrostline.com/client.js"
repo="allenfrostline/allenfrostline.github.io"
issue-term="pathname"
crossorigin="anonymous"
theme="github-light"
theme="nella-red"
async>
</script>
</if>
Expand All @@ -81,7 +81,7 @@
issue-term="pathname"
label="💬 comment"
crossorigin="anonymous"
theme="github-light"
theme="nella-red"
async>
</script>
</else>
Expand Down
55 changes: 55 additions & 0 deletions src/stylesheets/themes/nella-red/button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.btn-primary {
display: inline-block;
padding: 5px 8px;
background: $red-normal;
border-bottom: 4px solid $red-dark;
border-right: 4px solid $red-dark;
border-top-right-radius: 5px;
border-bottom-left-radius: 5px;
border-top-left-radius: 5px;
border-bottom-right-radius: 5px;
font-weight: 600;
font-size: 16px;
position: relative;
height: 34px;
line-height: 20px;
outline-width: 0px;
vertical-align: middle;
color: $white;
}

.btn-primary:hover {
background: $red-light;
}

.btn-primary:active {
background: $red-dark2;
}

.btn-primary:disabled {
background: $red-normal;
opacity: 0.4;
}

.btn-outline {
color: $gray-dark;
background: none;
vertical-align: middle;
border-width: 0px;
padding: 8px 6px!important;
}

.btn-outline:hover {
color: $black;
background: $red-lighter;
border-width: 0px;
}

.btn-outline:disabled {
color: $white;
border-width: 0px;
}

.reactions-popover summary {
padding: 8px 10px!important;
}
4 changes: 4 additions & 0 deletions src/stylesheets/themes/nella-red/font.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body, .markdown-body, .textarea {
font-family: Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Source Han Sans CN', 'Source Han Serif', 'Songti SC', serif;
font-size: 16px!important;
}
4 changes: 4 additions & 0 deletions src/stylesheets/themes/nella-red/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import "./variables";
@import "../../index";
@import "./syntax";
@import "./button.scss";
51 changes: 51 additions & 0 deletions src/stylesheets/themes/nella-red/misc.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
.timeline summary:hover {
color: $red-light;
}

.timeline a {
text-decoration: none;
}

.current-user .comment-header {
background: $red-lighter!important;
}

.author-association-badge {
border-color: $gray-dark!important;
}

.markdown-body a {
color: $red-light;
}

.markdown-body pre, code {
font-size: 14px!important;
}

.markdown-info svg {
vertical-align: -4px!important;
padding-left: 2px;
}

.timeline-comment button {
font-size: 14px;
}

.timeline-comment textarea {
font-size: 16px;
line-height: 24px;
}

.comment-footer {
border-width: 0;
line-height: 25px;
height: 40px!important;
}

.timeline-header em {
display: none;
}

.timeline-header .text-link {
font-style: italic;
}
1 change: 1 addition & 0 deletions src/stylesheets/themes/nella-red/syntax.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "github-syntax-light/lib/github-light";
6 changes: 6 additions & 0 deletions src/stylesheets/themes/nella-red/utterances.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@import "./variables";
@import "../../utterances";
@import "./syntax";
@import "./button.scss";
@import "./font.scss";
@import "./misc.scss"
21 changes: 21 additions & 0 deletions src/stylesheets/themes/nella-red/variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
$white: #ffffff;
$black: #000000;
$gray: #eeeeee;
$gray-dark: #999999;
$gray-darker: #444444;
$red-dark: #5E0001;
$red-dark2: #940002;
$red-normal: #B40203;
$red-light: #C80004;
$red-lighter: #FFF3F0;

$bg-white: $white;
$bg-gray: $white;
$bg-gray-light: $white;
$border-gray: $gray;
$border-gray-dark: $gray;
$text-gray: $black;
$text-gray-dark: $black;
$button-normal: $red-normal;
$button-hover: $red-light;
$button-pressed: $red-dark;
2 changes: 1 addition & 1 deletion src/utterances-api.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// export const UTTERANCES_API = 'http://localhost:7000';
export const UTTERANCES_API = 'https://api.utteranc.es';
export const UTTERANCES_API = 'https://utterances-oauth.allenfrostline.workers.dev';
2 changes: 1 addition & 1 deletion utterances.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"origins": ["https://utteranc.es"]
"origins": ["https://utterances.allenfrostline.com"]
}
Loading