From 364dc01c3b6218c12933d24f6d01dbbdf627ad10 Mon Sep 17 00:00:00 2001 From: Shan Carter Date: Tue, 29 Aug 2017 15:15:49 -0700 Subject: [PATCH 1/5] Adding super connected callback to math --- src/components/d-math.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/d-math.js b/src/components/d-math.js index 6fbf244..0a643fc 100644 --- a/src/components/d-math.js +++ b/src/components/d-math.js @@ -36,6 +36,7 @@ export class DMath extends Mutating(T(HTMLElement)) { } connectedCallback() { + super.connectedCallback(); if (!DMath.katexAdded) { // script tag has to be created to work properly const scriptTag = document.createElement('script'); From d01420a048e2aec7c3c44cf20a6e60d0a7c67ea3 Mon Sep 17 00:00:00 2001 From: Shan Carter Date: Tue, 29 Aug 2017 16:10:53 -0700 Subject: [PATCH 2/5] Figures now supported inside d-title --- src/components/d-title.js | 2 -- src/styles/styles-layout.css | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/d-title.js b/src/components/d-title.js index e54ef96..f888a67 100644 --- a/src/components/d-title.js +++ b/src/components/d-title.js @@ -51,8 +51,6 @@ d-byline { border-top: 1px solid rgba(0, 0, 0, 0.1); } -${page('::slotted(h1), ::slotted(h2)')} - diff --git a/src/styles/styles-layout.css b/src/styles/styles-layout.css index 846fd38..b75df9d 100644 --- a/src/styles/styles-layout.css +++ b/src/styles/styles-layout.css @@ -53,7 +53,8 @@ d-article > * { } .l-page, -d-figure { +d-figure, +d-title > * { grid-column: margin-left / page; } From 5d4f5ff53063049ca19a56a6bd040f7852e696ba Mon Sep 17 00:00:00 2001 From: Shan Carter Date: Tue, 29 Aug 2017 17:09:36 -0700 Subject: [PATCH 3/5] Left aligned math --- src/components/d-math.js | 13 +++++++++++++ src/components/d-title.js | 2 +- src/styles/styles-article.css | 1 - 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/d-math.js b/src/components/d-math.js index 0a643fc..1201ca7 100644 --- a/src/components/d-math.js +++ b/src/components/d-math.js @@ -17,6 +17,19 @@ const T = Template('d-math', ` display: block; } +#katex-container .katex-display { + text-align: left; + border-left: 2px solid #ddd; + padding: 8px 0 8px 36px; + margin: 20px 0; + color: rgba(0, 0, 0, 0.7); + -webkit-font-smoothing: antialiased; +} + +#katex-container .katex { + font-size: 1.2em; +} + ${katexCSSTag} diff --git a/src/components/d-title.js b/src/components/d-title.js index f888a67..89a804c 100644 --- a/src/components/d-title.js +++ b/src/components/d-title.js @@ -25,7 +25,7 @@ const T = Template('d-title', ` font-weight: 300 !important; padding-top: 0 !important; padding-bottom: 0 !important; - line-height: 1.5em !important; + line-height: 1.6em !important; margin-top: 0 !important; margin-bottom: 18px !important; } diff --git a/src/styles/styles-article.css b/src/styles/styles-article.css index 0c73176..2a7a1f7 100644 --- a/src/styles/styles-article.css +++ b/src/styles/styles-article.css @@ -1,4 +1,3 @@ - d-article { color: rgba(0, 0, 0, 0.8); padding-top: 0; From 65a9563d3f699342f57d0021bafb268260ab82b7 Mon Sep 17 00:00:00 2001 From: Shan Carter Date: Tue, 29 Aug 2017 17:12:04 -0700 Subject: [PATCH 4/5] Making code and math same --- src/components/d-code.js | 5 ++--- src/components/d-math.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/d-code.js b/src/components/d-code.js index 97f1dee..8536492 100644 --- a/src/components/d-code.js +++ b/src/components/d-code.js @@ -20,9 +20,8 @@ code { pre code { display: block; - background: white; - border-left: 3px solid rgba(0, 0, 0, 0.05); - padding: 0 0 0 24px; + border-left: 2px solid rgba(0, 0, 0, .1); + padding: 0 0 0 36px; } ${css} diff --git a/src/components/d-math.js b/src/components/d-math.js index 1201ca7..a29a73a 100644 --- a/src/components/d-math.js +++ b/src/components/d-math.js @@ -19,7 +19,7 @@ const T = Template('d-math', ` #katex-container .katex-display { text-align: left; - border-left: 2px solid #ddd; + border-left: 2px solid rgba(0, 0, 0, .1); padding: 8px 0 8px 36px; margin: 20px 0; color: rgba(0, 0, 0, 0.7); From efbb6e6a9263d8516abe52ada73425bc348136bf Mon Sep 17 00:00:00 2001 From: Shan Carter Date: Tue, 29 Aug 2017 17:42:10 -0700 Subject: [PATCH 5/5] No line on math --- src/components/d-math.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/d-math.js b/src/components/d-math.js index a29a73a..c0ab8f1 100644 --- a/src/components/d-math.js +++ b/src/components/d-math.js @@ -19,15 +19,14 @@ const T = Template('d-math', ` #katex-container .katex-display { text-align: left; - border-left: 2px solid rgba(0, 0, 0, .1); - padding: 8px 0 8px 36px; + padding: 8px 0 8px 0; margin: 20px 0; - color: rgba(0, 0, 0, 0.7); - -webkit-font-smoothing: antialiased; } #katex-container .katex { - font-size: 1.2em; + -webkit-font-smoothing: antialiased; + color: rgba(0, 0, 0, 0.8); + font-size: 1.18em; }