From e78b3c34348f26d40a813612c5a3786f1c56607a Mon Sep 17 00:00:00 2001 From: Yan Zhu Date: Tue, 29 Aug 2017 18:07:53 +0800 Subject: Initial SASS build --- src/_carousels.scss | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 src/_carousels.scss (limited to 'src/_carousels.scss') diff --git a/src/_carousels.scss b/src/_carousels.scss new file mode 100644 index 0000000..788d351 --- /dev/null +++ b/src/_carousels.scss @@ -0,0 +1,124 @@ +// Carousels +.carousel { + background: $bg-color; + display: block; + overflow: hidden; + position: relative; + width: 100%; + + .carousel-container { + height: 100%; + left: 0; + position: relative; + &::before { + content: ""; + display: block; + padding-bottom: 56.25%; + } + + .carousel-item { + animation: carousel-slideout 1s ease-in-out 1; + height: 100%; + left: 0; + margin: 0; + opacity: 0; + position: absolute; + top: 0; + width: 100%; + + &:hover { + .item-prev, + .item-next { + opacity: 1; + } + } + } + + .item-prev, + .item-next { + background: fade($gray-color-light, 25%); + border-color: fade($gray-color-light, 50%); + color: $gray-color-light; + opacity: 0; + position: absolute; + top: 50%; + transition: all .4s ease; + transform: translateY(-50%); + z-index: $zindex-2; + } + .item-prev { + left: 1rem; + } + .item-next { + right: 1rem; + } + } + + .carousel-locator { + &:nth-of-type(1):checked ~ .carousel-container .carousel-item:nth-of-type(1), + &:nth-of-type(2):checked ~ .carousel-container .carousel-item:nth-of-type(2), + &:nth-of-type(3):checked ~ .carousel-container .carousel-item:nth-of-type(3), + &:nth-of-type(4):checked ~ .carousel-container .carousel-item:nth-of-type(4) { + animation: carousel-slidein .75s ease-in-out 1; + opacity: 1; + z-index: $zindex-1; + } + &:nth-of-type(1):checked ~ .carousel-nav .nav-item:nth-of-type(1), + &:nth-of-type(2):checked ~ .carousel-nav .nav-item:nth-of-type(2), + &:nth-of-type(3):checked ~ .carousel-nav .nav-item:nth-of-type(3), + &:nth-of-type(4):checked ~ .carousel-nav .nav-item:nth-of-type(4) { + color: $gray-color-light; + } + } + + .carousel-nav { + bottom: $layout-spacing; + display: flex; + justify-content: center; + left: 50%; + position: absolute; + transform: translateX(-50%); + width: 10rem; + z-index: $zindex-2; + + .nav-item { + color: fade($gray-color-light, 50%); + display: block; + flex: 1 0 auto; + height: $unit-8; + margin: $unit-1; + max-width: 2.5rem; + position: relative; + + &::before { + background: currentColor; + content: ""; + display: block; + height: $border-width-lg; + position: absolute; + top: .5rem; + width: 100%; + } + } + } +} + +@keyframes carousel-slidein { + 0% { + transform: translateX(100%); + } + 100% { + transform: translateX(0); + } +} + +@keyframes carousel-slideout { + 0% { + opacity: 1; + transform: translateX(0); + } + 100% { + opacity: 1; + transform: translateX(-50%); + } +} -- cgit v1.3.1-26-gb76a From dd03f84e2ad7cffa517bee412d1e15e8de47f88d Mon Sep 17 00:00:00 2001 From: Yan Zhu Date: Wed, 30 Aug 2017 20:52:53 +0800 Subject: Fix LESS to SASS issues. Add Examples. --- docs/components.html | 6 ++-- docs/css/docs.css | 9 +++--- docs/dist/spectre-exp.css | 44 +++++++++++++-------------- docs/dist/spectre-exp.min.css | 2 +- docs/dist/spectre.css | 5 ++-- docs/dist/spectre.min.css | 2 +- docs/elements.html | 42 +++++++++++++------------- docs/examples/starter.html | 29 ++++++++++++++++++ docs/experimentals.html | 10 +++---- docs/getting-started.html | 70 +++++++++++++++++++++++-------------------- docs/index.html | 4 +-- docs/layout.html | 6 ++-- docs/src/docs.scss | 11 +++---- docs/utilities.html | 6 ++-- gulpfile.js | 6 ++-- src/_carousels.scss | 6 ++-- src/_chips.scss | 1 - src/_comparison-sliders.scss | 2 +- src/_parallax.scss | 34 ++++++++++----------- 19 files changed, 164 insertions(+), 131 deletions(-) create mode 100644 docs/examples/starter.html (limited to 'src/_carousels.scss') diff --git a/docs/components.html b/docs/components.html index 251401e..b4f90ed 100644 --- a/docs/components.html +++ b/docs/components.html @@ -1,10 +1,10 @@ - + - + Components - Spectre.css CSS Framework @@ -16,7 +16,7 @@