diff options
author | 2021-03-19 17:17:38 -0400 | |
---|---|---|
committer | 2021-03-19 17:17:38 -0400 | |
commit | 2082001ff8702ec48072b59caafe85573a3b2891 (patch) | |
tree | d160341cc51dd39e562a209cad6db168f768a259 /examples/snowpack/public/css/components/_toc.scss | |
parent | 17c3c98f07628b43b941b84831e8e1f9bcd7ca46 (diff) | |
download | astro-2082001ff8702ec48072b59caafe85573a3b2891.tar.gz astro-2082001ff8702ec48072b59caafe85573a3b2891.tar.zst astro-2082001ff8702ec48072b59caafe85573a3b2891.zip |
Add snowpack as an example project. (#11)
* Initial tests set up
This adds tests using uvu (we can switch if people want) and restructures things a bit so that it's easier to test.
Like in snowpack you set up a little project. In our tests you can say:
```js
const result = await runtime.load('/blog/hello-world')
```
And analyze the result. I included a `test-helpers.js` which has a function that will turn HTML into a cheerio instance, for inspecting the result HTML.
* Bring snowpack example in
* Formatting
Diffstat (limited to 'examples/snowpack/public/css/components/_toc.scss')
-rw-r--r-- | examples/snowpack/public/css/components/_toc.scss | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/examples/snowpack/public/css/components/_toc.scss b/examples/snowpack/public/css/components/_toc.scss new file mode 100644 index 000000000..8e23b358f --- /dev/null +++ b/examples/snowpack/public/css/components/_toc.scss @@ -0,0 +1,132 @@ +@use '../var' as *; + +/** + * Table of Contents (toc) + * The left-hand sidebar + */ + +$top-padding: 24px; + +%toc-link { + position: relative; + display: block; + color: $white; + text-decoration: none; + border: none; + transition: color 0.3s; + + @media (min-width: $breakpoint-m) { + color: $grey; + } + + &::before { + position: absolute; + top: -2px; + left: -19px; + font-weight: 400; + font-size: 26px; + line-height: 1; + opacity: 0; + transition: left .14s ease-out; + content: "▸"; + } + + + &:hover { + text-decoration: underline; + } + + &.active { + color: #0c8cec; + text-decoration: underline; + + &::before { + left: -17px; + opacity: 1; + } + } +} + +.snow-toc { + transition: padding 0.2s ease-out, opacity 0.2s ease-in-out; + + // ----------- + // Components + // ----------- + + &-contents { + margin: 0; + padding: 0; + line-height: 1.8; + list-style: none; + } + + &-link { + @extend %toc-link; + } + + &-section { + + .snow-toc-section { + margin-top: 1.5rem; + } + + &-header { + margin-top: 0; + margin-bottom: 8px; + color: rgba($white, 0.6); + font-weight: 600; + font-size: 20px; + font-family: $heading; + line-height: 1.2em; + + @media (min-width: $breakpoint-m) { + color: $dark-grey; + } + } + + &-items { + margin: 0; + padding: 0; + list-style: none; + } + } + + // ---------- + // Modifiers + // ---------- + + &__subnav { + position: static; + z-index: 1; + padding-top: 2rem; + + .snow-toc-section-header { + color: $dark-grey; + } + + hr { + display: block; + height: 1px; + margin: 1rem 0; + background-color: $light-grey; + border: none; + appearance: none; + } + + ol { + margin: 0; + padding: 0; + list-style: none; + } + + li { + line-height: 1.8; + } + + a { + @extend %toc-link; + + color: $grey; + } + } +} |