diff --git a/boilerplate/build.js b/boilerplate/build.js index 60982772f40..e253c1a5a7d 100644 --- a/boilerplate/build.js +++ b/boilerplate/build.js @@ -39,7 +39,7 @@ function initConfig() { formats: require('./data/formats.json'), templates: templates.find('./templates/files'), highlightTheme: - io.readFile(path.join(__dirname, '../node_modules/highlight.js/styles/monokai.css')), + io.readFile(path.join(__dirname, './templates/styles/code-snippet.scss')), }; // assign default template let defaultTemplate; diff --git a/boilerplate/data/formats.json b/boilerplate/data/formats.json index 7fc5c931e6a..f6985d6a2e4 100644 --- a/boilerplate/data/formats.json +++ b/boilerplate/data/formats.json @@ -8,12 +8,12 @@ "id": "stories", "name": "Stories" }, - { - "id": "email", - "name": "Email" - }, { "id": "ads", "name": "Ads" + }, + { + "id": "email", + "name": "Email" } ] diff --git a/boilerplate/templates/index.html b/boilerplate/templates/index.html index 99582ea1731..4a2604865e2 100644 --- a/boilerplate/templates/index.html +++ b/boilerplate/templates/index.html @@ -138,28 +138,42 @@

Select Format

What do you want to build with AMP?

- +
+ +
+ {{#formats}} + + + + + + {{id}} + {{/formats}} +
+

Select Features

diff --git a/boilerplate/templates/styles/code-snippet.scss b/boilerplate/templates/styles/code-snippet.scss new file mode 100644 index 00000000000..8efbf8ecd46 --- /dev/null +++ b/boilerplate/templates/styles/code-snippet.scss @@ -0,0 +1,80 @@ +/* +Monokai style +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #272822; color: #ddd; +} + +.hljs-tag { + color: #f8f8f2; +} + +.hljs-number { + color: #ae81ff; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-strong, +.hljs-name { + color: #f15a5a; +} + +.hljs-code, +.hljs-attribute { + color: #66d9ef; +} + +.hljs-class .hljs-title { + color: #ffffff; +} + +.hljs-symbol, +.hljs-regexp, +.hljs-link { + color: #bf79db; +} + +.hljs-string { + color: #e6db74; +} + +.hljs-attr, +.hljs-bullet, +.hljs-subst, +.hljs-title, +.hljs-section, +.hljs-emphasis, +.hljs-type, +.hljs-built_in, +.hljs-builtin-name, +.hljs-selector-pseudo, +.hljs-addition, +.hljs-variable, +.hljs-template-tag, +.hljs-template-variable { + color: #a6e22e; +} + +.hljs-comment, +.hljs-quote, +.hljs-deletion, +.hljs-meta { + color: #75715e; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-doctag, +.hljs-title, +.hljs-section, +.hljs-type, +.hljs-selector-id { + font-weight: normal; +} diff --git a/boilerplate/templates/styles/main.scss b/boilerplate/templates/styles/main.scss index 935809234ed..746a48bcd15 100644 --- a/boilerplate/templates/styles/main.scss +++ b/boilerplate/templates/styles/main.scss @@ -28,10 +28,52 @@ pre { max-height: 100%; } + code { + @include txt-mono; + } } .#{molecule('format-toggle')} { margin-left: 0; + max-width: 240px; + + .#{molecule('format-toggle')}-angle { + transition: all 0.2s ease; + transition-delay: 0.05s; + } + + &.open .#{molecule('format-toggle')}-angle { + transform: rotate(-180deg); + } + + &-link { + &.active { + display: none; + } + } + + &-link, + &-selected { + line-height: 2rem; + font-size: 16px; + } + + &-formats { + .#{molecule('format-toggle')}-selected:focus + &, + .#{molecule('format-toggle')}-selected:hover + &, + &:focus-within, + &:hover { + pointer-events: none; + opacity: 0; + transform: translateY(-20px); + } + + .#{molecule('format-toggle')}.open & { + pointer-events: auto; + opacity: 1; + transform: translateY(0); + } + } } main { diff --git a/frontend/scss/components/molecules/format-toggle.scss b/frontend/scss/components/molecules/format-toggle.scss index bd86d1f164a..47595b50d82 100644 --- a/frontend/scss/components/molecules/format-toggle.scss +++ b/frontend/scss/components/molecules/format-toggle.scss @@ -19,6 +19,9 @@ } &-selected { + .amp-mode-touch & { + position: relative; + } border: 0; &:focus, &:hover {