diff --git a/_widget/old_src/App.vue b/_widget/old_src/App.vue deleted file mode 100644 index 81c28ec8c..000000000 --- a/_widget/old_src/App.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - - - diff --git a/_widget/old_src/assets/vue.svg b/_widget/old_src/assets/vue.svg deleted file mode 100644 index 770e9d333..000000000 --- a/_widget/old_src/assets/vue.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/_widget/old_src/components/HelloWorld.vue b/_widget/old_src/components/HelloWorld.vue deleted file mode 100644 index 546ebbc62..000000000 --- a/_widget/old_src/components/HelloWorld.vue +++ /dev/null @@ -1,43 +0,0 @@ - - - - - diff --git a/_widget/old_src/main.js b/_widget/old_src/main.js deleted file mode 100644 index 2425c0f74..000000000 --- a/_widget/old_src/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import { createApp } from 'vue' -import './style.css' -import App from './App.vue' - -createApp(App).mount('#app') diff --git a/_widget/old_src/style.css b/_widget/old_src/style.css deleted file mode 100644 index bb131d6b8..000000000 --- a/_widget/old_src/style.css +++ /dev/null @@ -1,79 +0,0 @@ -:root { - font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; - line-height: 1.5; - font-weight: 400; - - color-scheme: light dark; - color: rgba(255, 255, 255, 0.87); - background-color: #242424; - - font-synthesis: none; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -a { - font-weight: 500; - color: #646cff; - text-decoration: inherit; -} -a:hover { - color: #535bf2; -} - -body { - margin: 0; - display: flex; - place-items: center; - min-width: 320px; - min-height: 100vh; -} - -h1 { - font-size: 3.2em; - line-height: 1.1; -} - -button { - border-radius: 8px; - border: 1px solid transparent; - padding: 0.6em 1.2em; - font-size: 1em; - font-weight: 500; - font-family: inherit; - background-color: #1a1a1a; - cursor: pointer; - transition: border-color 0.25s; -} -button:hover { - border-color: #646cff; -} -button:focus, -button:focus-visible { - outline: 4px auto -webkit-focus-ring-color; -} - -.card { - padding: 2em; -} - -#app { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; -} - -@media (prefers-color-scheme: light) { - :root { - color: #213547; - background-color: #ffffff; - } - a:hover { - color: #747bff; - } - button { - background-color: #f9f9f9; - } -} diff --git a/_widget/src/components/app/component.vue b/_widget/src/components/app/component.vue index ef2c85cd2..0f04b153e 100644 --- a/_widget/src/components/app/component.vue +++ b/_widget/src/components/app/component.vue @@ -19,8 +19,8 @@ import Articles from '../articles/component.vue'; import Prompt from '../prompt/component.vue'; import Welcome from '../welcome/component.vue'; -import "./reset.scss" import "./variables.scss" +import "./reset.scss" import "./style.scss" const ANIMATION_TIMEOUT = 500; diff --git a/_widget/src/components/app/style.scss b/_widget/src/components/app/style.scss index 9da4c7bdf..cecea5ae8 100644 --- a/_widget/src/components/app/style.scss +++ b/_widget/src/components/app/style.scss @@ -1,42 +1,31 @@ -@import './variables.scss'; -@import './reset.scss'; - #dnsimple-support { position: fixed; bottom: 0; right: 0; width: 480px; - font-size: $rem; + font-size: var(--dnsimple-support-widget-rem); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; line-height: 1.6; color: #222; z-index: 999; - @media ($desktop-only) { + @media (var(--dnsimple-support-widget-desktop-only)) { display: none; } } - #dnsimple-support { - @import '../article/style.scss'; - @import '../articles/style.scss'; - @import '../footer/style.scss'; - @import '../header/style.scss'; - @import '../prompt/style.scss'; - @import '../welcome/style.scss'; - .relative { position: relative; - box-shadow: $box-shadow; + box-shadow: var(--dnsimple-support-widget-box-shadow); } .route { height: 475px; - border-left: 1px solid $line-color; + border-left: 1px solid var(--dnsimple-support-widget-line-color); overflow-y: auto; -webkit-overflow-scrolling: touch; - padding: $padding; - background: $white; + padding: var(--dnsimple-support-widget-padding); + background: var(--dnsimple-support-widget-white); } } diff --git a/_widget/src/components/app/variables.scss b/_widget/src/components/app/variables.scss index 578129284..c13e86bf2 100644 --- a/_widget/src/components/app/variables.scss +++ b/_widget/src/components/app/variables.scss @@ -1,15 +1,18 @@ -$blue: #1A5EC6; -$dark-gray: #333; -$medium-gray: #7e7e7e; -$light-gray: #eaeaea; -$yellow: #f8c939; -$orange: #ff7f2a; -$green: #43a047; -$white: #fff; -$rem: 16px; -$padding: 15px; -$line-color: #ddd; -$desktop-only: "max-width: 640px"; -$font-monospace: Menlo,Monaco,Consolas,"Courier New",monospace; -$font-size-monospace: 13px; -$box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); +#dnsimple-support { + --dnsimple-support-widget-blue: #1A5EC6; + --dnsimple-support-widget-dark-gray: #333; + --dnsimple-support-widget-medium-gray: #7e7e7e; + --dnsimple-support-widget-light-gray: #eaeaea; + --dnsimple-support-widget-yellow: #f8c939; + --dnsimple-support-widget-orange: #ff7f2a; + --dnsimple-support-widget-green: #43a047; + --dnsimple-support-widget-white: #fff; + --dnsimple-support-widget-rem: 16px; + --dnsimple-support-widget-padding: 15px; + --dnsimple-support-widget-line-color: #ddd; + --dnsimple-support-widget-desktop-only: "max-width: 640px"; + --dnsimple-support-widget-font-monospace: Menlo,Monaco,Consolas,"Courier New",monospace; + --dnsimple-support-widget-font-size-monospace: 13px; + --dnsimple-support-widget-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + --dnsimple-support-widget-prompt-padding: 7px; +} diff --git a/_widget/src/components/article/component.vue b/_widget/src/components/article/component.vue index 435193e70..0239a741c 100644 --- a/_widget/src/components/article/component.vue +++ b/_widget/src/components/article/component.vue @@ -16,6 +16,11 @@ import { backIcon } from '../../assets/svgs'; import Footer from '../footer/component.vue'; +import "./style.scss" +import "./resolving.scss" +import "./syntax.scss" +import "./tables.scss" + const NO_TRAILING_SLASH = /\/?$/; export default { diff --git a/_widget/src/components/article/resolving.scss b/_widget/src/components/article/resolving.scss index 373b4e116..a2c1a09b6 100644 --- a/_widget/src/components/article/resolving.scss +++ b/_widget/src/components/article/resolving.scss @@ -1,17 +1,21 @@ // Derived from support.dnsimple.com/content/assets/css/_resolving -.resolving { - padding: $padding; - margin-bottom: $padding; -} +#dnsimple-support { + .article { + .resolving { + padding: var(--dnsimple-support-widget-padding); + margin-bottom: var(--dnsimple-support-widget-padding); + } -.resolving-light { - background: #eee; -} + .resolving-light { + background: #eee; + } -.resolving-dark { - background: #000; - a { - color: #fff; + .resolving-dark { + background: #000; + a { + color: #fff; + } + } } } diff --git a/_widget/src/components/article/style.scss b/_widget/src/components/article/style.scss index caa2bfe76..cc19de68d 100644 --- a/_widget/src/components/article/style.scss +++ b/_widget/src/components/article/style.scss @@ -1,137 +1,135 @@ -.article { - @import "./syntax.css"; - @import "./resolving.css"; - @import "./tables.css"; +#dnsimple-support { + .article { + h1, h2, h3, h4, h5, h6, p, ul, ol, .table-wrapper, pre, warning, note, tip, info, .marker { + margin-bottom: var(--dnsimple-support-widget-padding); + } - h1, h2, h3, h4, h5, h6, p, ul, ol, .table-wrapper, pre, warning, note, tip, info, .marker { - margin-bottom: $padding; - } + h1 { + font-size: 160%; + line-height: 1.3; + color: var(--dnsimple-support-widget-blue); + font-weight: bold; + margin-bottom: var(--dnsimple-support-widget-padding); + } - h1 { - font-size: 160%; - line-height: 1.3; - color: $blue; - font-weight: bold; - margin-bottom: $padding; - } + h2 { + font-size: 140%; + color: #222; + font-weight: bold; + } - h2 { - font-size: 140%; - color: #222; - font-weight: bold; - } + h3 { + font-size: 130%; + color: var(--dnsimple-support-widget-blue); + font-weight: bold; + + &#toc { + background: var(--dnsimple-support-widget-medium-gray); + color: #fff; + text-transform: uppercase; + font-weight: normal; + font-size: 80%; + margin-bottom: 0; + padding: 5px 5px 5px 26px; + } + } - h3 { - font-size: 130%; - color: $blue; - font-weight: bold; + h4 { + font-size: 120%; + color: #555; + font-style: oblique; + } - &#toc { - background: $medium-gray; - color: #fff; - text-transform: uppercase; - font-weight: normal; - font-size: 80%; - margin-bottom: 0; - padding: 5px 5px 5px 26px; + h5 { + font-size: 110%; + color: #888; + font-style: oblique; } - } - h4 { - font-size: 120%; - color: #555; - font-style: oblique; - } + a { + color: var(--dnsimple-support-widget-blue); + transition: all 0.2s ease; - h5 { - font-size: 110%; - color: #888; - font-style: oblique; - } + &:hover { + text-decoration: underline; + } + } - a { - color: $blue; - transition: all 0.2s ease; + hr { + margin: 20px 0; + border: 0; + border-top: 1px solid var(--dnsimple-support-widget-line-color); + } - &:hover { - text-decoration: underline; + ul, ol { + margin-left: 25px; } - } - hr { - margin: 20px 0; - border: 0; - border-top: 1px solid $line-color; - } + ul { + list-style: disc; + } - ul, ol { - margin-left: 25px; - } + ol { + list-style: decimal; + } - ul { - list-style: disc; - } + pre { + display: block; + overflow-x: scroll; + padding: 10px; + font-family: var(--dnsimple-support-widget-font-monospace); + font-size: var(--dnsimple-support-widget-font-size-monospace); + background-color: #f5f5f5; + border: 1px solid #ccc; + word-break: break-all; + word-wrap: break-word; + border-radius: 4px; + } - ol { - list-style: decimal; - } + warning, note, tip, info, .marker, #markdown-toc { + display: block; + padding: var(--dnsimple-support-widget-padding); + overflow: auto; + background: var(--dnsimple-support-widget-light-gray); + -webkit-overflow-scrolling: touch; + margin-left: 6px; + + *:last-child { + margin-bottom: 0; + } + } - pre { - display: block; - overflow-x: scroll; - padding: 10px; - font-family: $font-monospace; - font-size: $font-size-monospace; - background-color: #f5f5f5; - border: 1px solid #ccc; - word-break: break-all; - word-wrap: break-word; - border-radius: 4px; - } + warning, .marker-warning { + box-shadow: -6px 0 0 0 var(--dnsimple-support-widget-orange); + } - warning, note, tip, info, .marker, #markdown-toc { - display: block; - padding: $padding; - overflow: auto; - background: $light-gray; - -webkit-overflow-scrolling: touch; - margin-left: 6px; + tip, .marker-tip { + box-shadow: -6px 0 0 0 var(--dnsimple-support-widget-green); + } - *:last-child { - margin-bottom: 0; + note, .marker-note { + box-shadow: -6px 0 0 0 var(--dnsimple-support-widget-yellow); } - } - warning, .marker-warning { - box-shadow: -6px 0 0 0 $orange; - } + info, .marker-info, #markdown-toc { + box-shadow: -6px 0 0 0 var(--dnsimple-support-widget-medium-gray); + } - tip, .marker-tip { - box-shadow: -6px 0 0 0 $green; - } + #markdown-toc { + padding-left: 40px; - note, .marker-note { - box-shadow: -6px 0 0 0 $yellow; + a { + color: inherit; + text-decoration: underline; + } + } } - info, .marker-info, #markdown-toc { - box-shadow: -6px 0 0 0 $medium-gray; + b, strong { + font-weight: bold; } - #markdown-toc { - padding-left: 40px; - - a { - color: inherit; - text-decoration: underline; - } + i, em { + font-style: oblique; } } - -b, strong { - font-weight: bold; -} - -i, em { - font-style: oblique; -} diff --git a/_widget/src/components/article/syntax.scss b/_widget/src/components/article/syntax.scss index 583cd831c..a9403a5fe 100644 --- a/_widget/src/components/article/syntax.scss +++ b/_widget/src/components/article/syntax.scss @@ -1,62 +1,66 @@ // Derived from support.dnsimple.com/content/assets/css/_syntax // code { background: #ffffff; } -code .c { color: #999988; font-style: italic } /* Comment */ -code .err { color: #a61717; background-color: #e3d2d2 } /* Error */ -code .k { font-weight: bold } /* Keyword */ -code .o { font-weight: bold } /* Operator */ -code .cm { color: #999988; font-style: italic } /* Comment.Multiline */ -code .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ -code .c1 { color: #999988; font-style: italic } /* Comment.Single */ -code .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ -code .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ -code .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */ -code .ge { font-style: italic } /* Generic.Emph */ -code .gr { color: #aa0000 } /* Generic.Error */ -code .gh { color: #999999 } /* Generic.Heading */ -code .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ -code .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */ -code .go { color: #888888 } /* Generic.Output */ -code .gp { color: #555555 } /* Generic.Prompt */ -code .gs { font-weight: bold } /* Generic.Strong */ -code .gu { color: #aaaaaa } /* Generic.Subheading */ -code .gt { color: #aa0000 } /* Generic.Traceback */ -code .kc { font-weight: bold } /* Keyword.Constant */ -code .kd { font-weight: bold } /* Keyword.Declaration */ -code .kp { font-weight: bold } /* Keyword.Pseudo */ -code .kr { font-weight: bold } /* Keyword.Reserved */ -code .kt { color: #445588; font-weight: bold } /* Keyword.Type */ -code .m { color: #009999 } /* Literal.Number */ -code .s { color: #d14 } /* Literal.String */ -code .na { color: #008080 } /* Name.Attribute */ -code .nb { color: #0086B3 } /* Name.Builtin */ -code .nc { color: #445588; font-weight: bold } /* Name.Class */ -code .no { color: #008080 } /* Name.Constant */ -code .ni { color: #800080 } /* Name.Entity */ -code .ne { color: #990000; font-weight: bold } /* Name.Exception */ -code .nf { color: #990000; font-weight: bold } /* Name.Function */ -code .nn { color: #555555 } /* Name.Namespace */ -code .nt { color: #000080 } /* Name.Tag */ -code .nv { color: #008080 } /* Name.Variable */ -code .ow { font-weight: bold } /* Operator.Word */ -code .w { color: #bbbbbb } /* Text.Whitespace */ -code .mf { color: #009999 } /* Literal.Number.Float */ -code .mh { color: #009999 } /* Literal.Number.Hex */ -code .mi { color: #009999 } /* Literal.Number.Integer */ -code .mo { color: #009999 } /* Literal.Number.Oct */ -code .sb { color: #d14 } /* Literal.String.Backtick */ -code .sc { color: #d14 } /* Literal.String.Char */ -code .sd { color: #d14 } /* Literal.String.Doc */ -code .s2 { color: #d14 } /* Literal.String.Double */ -code .se { color: #d14 } /* Literal.String.Escape */ -code .sh { color: #d14 } /* Literal.String.Heredoc */ -code .si { color: #d14 } /* Literal.String.Interpol */ -code .sx { color: #d14 } /* Literal.String.Other */ -code .sr { color: #009926 } /* Literal.String.Regex */ -code .s1 { color: #d14 } /* Literal.String.Single */ -code .ss { color: #990073 } /* Literal.String.Symbol */ -code .bp { color: #999999 } /* Name.Builtin.Pseudo */ -code .vc { color: #008080 } /* Name.Variable.Class */ -code .vg { color: #008080 } /* Name.Variable.Global */ -code .vi { color: #008080 } /* Name.Variable.Instance */ -code .il { color: #009999 } /* Literal.Number.Integer.Long */ +#dnsimple-support { + .article { + code .c { color: #999988; font-style: italic } /* Comment */ + code .err { color: #a61717; background-color: #e3d2d2 } /* Error */ + code .k { font-weight: bold } /* Keyword */ + code .o { font-weight: bold } /* Operator */ + code .cm { color: #999988; font-style: italic } /* Comment.Multiline */ + code .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ + code .c1 { color: #999988; font-style: italic } /* Comment.Single */ + code .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ + code .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ + code .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */ + code .ge { font-style: italic } /* Generic.Emph */ + code .gr { color: #aa0000 } /* Generic.Error */ + code .gh { color: #999999 } /* Generic.Heading */ + code .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ + code .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */ + code .go { color: #888888 } /* Generic.Output */ + code .gp { color: #555555 } /* Generic.Prompt */ + code .gs { font-weight: bold } /* Generic.Strong */ + code .gu { color: #aaaaaa } /* Generic.Subheading */ + code .gt { color: #aa0000 } /* Generic.Traceback */ + code .kc { font-weight: bold } /* Keyword.Constant */ + code .kd { font-weight: bold } /* Keyword.Declaration */ + code .kp { font-weight: bold } /* Keyword.Pseudo */ + code .kr { font-weight: bold } /* Keyword.Reserved */ + code .kt { color: #445588; font-weight: bold } /* Keyword.Type */ + code .m { color: #009999 } /* Literal.Number */ + code .s { color: #d14 } /* Literal.String */ + code .na { color: #008080 } /* Name.Attribute */ + code .nb { color: #0086B3 } /* Name.Builtin */ + code .nc { color: #445588; font-weight: bold } /* Name.Class */ + code .no { color: #008080 } /* Name.Constant */ + code .ni { color: #800080 } /* Name.Entity */ + code .ne { color: #990000; font-weight: bold } /* Name.Exception */ + code .nf { color: #990000; font-weight: bold } /* Name.Function */ + code .nn { color: #555555 } /* Name.Namespace */ + code .nt { color: #000080 } /* Name.Tag */ + code .nv { color: #008080 } /* Name.Variable */ + code .ow { font-weight: bold } /* Operator.Word */ + code .w { color: #bbbbbb } /* Text.Whitespace */ + code .mf { color: #009999 } /* Literal.Number.Float */ + code .mh { color: #009999 } /* Literal.Number.Hex */ + code .mi { color: #009999 } /* Literal.Number.Integer */ + code .mo { color: #009999 } /* Literal.Number.Oct */ + code .sb { color: #d14 } /* Literal.String.Backtick */ + code .sc { color: #d14 } /* Literal.String.Char */ + code .sd { color: #d14 } /* Literal.String.Doc */ + code .s2 { color: #d14 } /* Literal.String.Double */ + code .se { color: #d14 } /* Literal.String.Escape */ + code .sh { color: #d14 } /* Literal.String.Heredoc */ + code .si { color: #d14 } /* Literal.String.Interpol */ + code .sx { color: #d14 } /* Literal.String.Other */ + code .sr { color: #009926 } /* Literal.String.Regex */ + code .s1 { color: #d14 } /* Literal.String.Single */ + code .ss { color: #990073 } /* Literal.String.Symbol */ + code .bp { color: #999999 } /* Name.Builtin.Pseudo */ + code .vc { color: #008080 } /* Name.Variable.Class */ + code .vg { color: #008080 } /* Name.Variable.Global */ + code .vi { color: #008080 } /* Name.Variable.Instance */ + code .il { color: #009999 } /* Literal.Number.Integer.Long */ + } +} diff --git a/_widget/src/components/article/tables.scss b/_widget/src/components/article/tables.scss index dad9e34f4..04ceeac23 100644 --- a/_widget/src/components/article/tables.scss +++ b/_widget/src/components/article/tables.scss @@ -1,28 +1,32 @@ // Derived from support.dnsimple.com/content/assets/css/_tables -.table-wrapper { - overflow-x: auto; - -webkit-overflow-scrolling: touch; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.15); - border-radius: 3px; +#dnsimple-support { + .article { + .table-wrapper { + overflow-x: auto; + -webkit-overflow-scrolling: touch; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.15); + border-radius: 3px; - table { - background: $white; - width: 100%; - border-collapse: collapse; + table { + background: var(--dnsimple-support-widget-white); + width: 100%; + border-collapse: collapse; - th, td { - padding: 0.6rem 1.2rem; - } + th, td { + padding: 0.6rem 1.2rem; + } - th { - border-bottom: 2px solid $yellow; - font-weight: bold; - background: $white; - } + th { + border-bottom: 2px solid var(--dnsimple-support-widget-yellow); + font-weight: bold; + background: var(--dnsimple-support-widget-white); + } - tr:nth-child(2n + 1) { - background-color: #f1f1f1; + tr:nth-child(2n + 1) { + background-color: #f1f1f1; + } + } } } } diff --git a/_widget/src/components/articles/component.vue b/_widget/src/components/articles/component.vue index 8bae931c0..d0789da67 100644 --- a/_widget/src/components/articles/component.vue +++ b/_widget/src/components/articles/component.vue @@ -33,6 +33,8 @@ import Footer from '../footer/component.vue'; import { spinnerIcon } from '../../assets/svgs'; +import "./style.scss" + export default { props: { app: Object diff --git a/_widget/src/components/articles/style.scss b/_widget/src/components/articles/style.scss index c642e6c66..9d421517b 100644 --- a/_widget/src/components/articles/style.scss +++ b/_widget/src/components/articles/style.scss @@ -1,31 +1,33 @@ -.articles { - margin-top: -$padding; +#dnsimple-support { + .articles { + margin-top: -var(--dnsimple-support-widget-padding); - h3 { - color: $blue; - font-weight: bold; - } + h3 { + color: var(--dnsimple-support-widget-blue); + font-weight: bold; + } - mark { - background: #fff3b6; - padding: 2px 0; - } + mark { + background: #fff3b6; + padding: 2px 0; + } - li { - padding: $padding 0; - border-bottom: 1px solid $line-color; + li { + padding: var(--dnsimple-support-widget-padding) 0; + border-bottom: 1px solid var(--dnsimple-support-widget-line-color); - &:last-child { - border-bottom: 0; + &:last-child { + border-bottom: 0; + } } } -} -.loading { - text-align: center; - padding: 25vh 0; + .loading { + text-align: center; + padding: 25vh 0; - img { - width: 8vh; + img { + width: 8vh; + } } } diff --git a/_widget/src/components/footer/component.vue b/_widget/src/components/footer/component.vue index be6712417..1e9acfb0d 100644 --- a/_widget/src/components/footer/component.vue +++ b/_widget/src/components/footer/component.vue @@ -13,6 +13,8 @@