]> _ Git - c6-wordpress.git/commitdiff
WIP #2684 @5
authorStephen Cameron <stephen@cubedesigners.com>
Tue, 23 Apr 2019 19:25:47 +0000 (21:25 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Tue, 23 Apr 2019 19:25:47 +0000 (21:25 +0200)
wp-content/themes/c6/resources/assets/styles/common/overlaps.styl
wp-content/themes/c6/resources/assets/styles/layouts/sections.styl
wp-content/themes/c6/resources/assets/styles/widgets/text-block.styl

index 8959534e806014c54add0d468ffed5f450d15a5b..b95b9a8c7d62e8dba4a8b4b7099af228001a31b9 100644 (file)
@@ -1,5 +1,7 @@
 // Overlapping Elements
 
+// ToDo: handle smaller screens - remove overlaps?
+
 // Normally this class should be applied to the column to pull up or push down...
 .overlap
   &-above
@@ -9,3 +11,21 @@
   &-below
     constrain(margin-bottom, -5vw)
     z-index: 2
+
+  // Right and left overlaps
+  // Element needs to be 5vw wider than 100% so it sits over the neighbour
+  &-right, &-left
+    z-index: 2
+
+    .elementor-widget-container
+      width: calc(100% + 5vw)
+
+      +above($content-max-width)
+        width: s('calc(100% + %s)', $content-max-width * 0.05) // 5vw cap for large screens
+
+  &-left
+    .elementor-widget-container
+      transform: translateX(-5vw)
+
+      +above($content-max-width)
+        transform: s('translateX(-%s)', $content-max-width * 0.05) // 5vw cap for large screens
index 72b6a8fad02d009a90ab40850d95279a4261fafb..559859985f1f34e626124ce518d0d9abf4bed3c2 100644 (file)
@@ -7,6 +7,12 @@
       &:not(:last-of-type)
         margin-bottom: 7.5vw
 
+  //--- Default section layout
+  &.layout-default
+    > .elementor-container
+      center($content-max-width * 0.8) // 1920px * 0.8 = 1536px
+      horizontal-spacing(5vw)
+      box-sizing: content-box // So padding doesn't influence max-width
 
 //--- Reversed layout
 // Handle column swapping when layout reversed toggle is set
   .elementor-row
     flex-direction: row-reverse
 
-//--- Full bleed layout
-// Image touches edge of screen when at or below max-content-width
-.layout-full-bleed
-  .elementor-container
-    padding-left: 0
-    padding-right: 0
-
-  // Columns (text 52.5% / image 47.5%)
-  .elementor-column
-    // Text is assumed to be first always (it can be reversed via flexbox for display reasons)
-    &:first-of-type
-      constrain(padding-left, 12.5vw)
-      constrain(padding-right, 10vw)
-      width: 52.5%
-    &:last-of-type
-      width: 47.5%
-
-  // Reversed layout adjustments
-  &.layout-reversed
-    .elementor-column
-      &:first-of-type
-        constrain(padding-left, 10vw)
-        constrain(padding-right, 12.5vw)
-
-
-//--- Offset Images layout
-// Tighter gap between text and image in the centre
-.layout-offset
-  .elementor-container
-    horizontal-spacing(5vw) // There's always 5vw either side so set it here to save some effort when reversing the layout
-
-  .elementor-column
-    &:first-of-type
-      constrain(padding-left, 7.5vw) // Actually 12.5vw but outer container already has 5vw on left
-      constrain(padding-right, 5vw)
-      width: 47.5%
-    &:last-of-type
-      width: 52.5%
-
-  // Reversed layout adjustments
-  &.layout-reversed
-    .elementor-column
-      &:first-of-type
-        constrain(padding-left, 5vw)
-        constrain(padding-right, 7.5vw)
-
-
-.layout-slideshow
-  .elementor-container
-    constrain(padding-left, 7.5vw)
-    padding-right: 0
-
-  // Make next image partially visible
-  // Ref: https://stackoverflow.com/a/43090848
-  .slick-list
-    padding-right: 7.5%
-    constrain(margin-left, -2.5vw) // Offset padding between slides so that first slide sits flush with edge
-    *
-      outline: none
-
-  .slick-slide-inner
-    constrain(padding-left, 2.5vw)
-
-  .text-block
-    horizontal-spacing(5vw)
-
index 0daeb9430adb11ec73c048a40ff8961541be884b..64d255bdca81cfcd8aa3e06737b41744314876c8 100644 (file)
@@ -1,18 +1,15 @@
 // Text block widget (Elementor defaults)
 // Padding is applied here so it can be overridden by Elementor
 .elementor-widget-cube-text .elementor-widget-container
-  //horizontal-spacing(5vw)
-  //vertical-spacing()
+  center(480px)
+  constrain(padding-left, 5vw)
+  constrain(padding-right, 5vw)
+  box-sizing: content-box // So padding doesn't influence max-width
 
   // When in a "default" section layout, add some padding
-  .layout-default &
-    constrain(padding-left, 7.5vw)
+  //.layout-default &
+  //  constrain(padding-left, 7.5vw)
 
-  // Text-only layout - constrain width of text blocks and centre block
-  .layout-text-only &
-    max-width: 800px
-    margin-left: auto
-    margin-right: auto
 
 .text-block