]> _ Git - c6-wordpress.git/commitdiff
WIP #2684 @4
authorStephen Cameron <stephen@cubedesigners.com>
Wed, 24 Apr 2019 18:32:55 +0000 (20:32 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Wed, 24 Apr 2019 18:32:55 +0000 (20:32 +0200)
wp-content/mu-plugins/cube/src/Elementor/Widgets/Heading.php
wp-content/mu-plugins/cube/src/Elementor/Widgets/TextBlock.php
wp-content/themes/c6/resources/assets/styles/common/global.styl
wp-content/themes/c6/resources/assets/styles/common/utilities.styl
wp-content/themes/c6/resources/assets/styles/widgets/heading.styl
wp-content/themes/c6/resources/assets/styles/widgets/text-block.styl

index 70fcf19c71c9e2646a2e97bf0d6be24c3ac5088b..efa5c75cd702ddcb14e6be16da989ff29ab0160d 100644 (file)
@@ -26,7 +26,7 @@ class Heading extends Widget_Base
 
     // Elementor interface icon
     public function get_icon() {
-        return 'eicon-align-left';
+        return 'eicon-heading';
     }
 
     // Where to display the widget in the Elementor interface
@@ -106,11 +106,19 @@ class Heading extends Widget_Base
         $this->add_render_attribute('title', 'class', ['heading-title']);
 
         // Rendered content
-        echo '<div class="heading"> ';
-        if (!empty($subtitle)) echo "<h3 {$this->get_render_attribute_string('subtitle')}>$subtitle</h3>";
-        if (!empty($title)) echo "<h2 {$this->get_render_attribute_string('title')}>$title</h2>";
+        echo '<div class="heading">';
 
-        echo '</div> ';
+        if (!empty($subtitle)) {
+            echo '<div class="heading-subtitle-wrapper">';
+            echo "<h3 {$this->get_render_attribute_string('subtitle')}>$subtitle</h3>";
+            echo '</div>';
+        }
+
+        if (!empty($title)) {
+            echo "<h2 {$this->get_render_attribute_string('title')}>$title</h2>";
+        }
+
+        echo '</div>';
     }
 
     /**
index 27feca8eed91fee8c7f700be52ec7ab958e911bf..6a5793e0d88fb1aa7636479526ae1b5411542374 100644 (file)
@@ -76,20 +76,6 @@ class TextBlock extends Widget_Base {
                        ]
         );
 
-        $this->add_control(
-                       'title_decoration',
-                       [
-                               'label' => __( 'Hide title decoration?', 'cube' ),
-                               'type' => Controls_Manager::SWITCHER,
-                'selectors' => [
-                    "{{WRAPPER}} .text-block-title:after" => 'display: none',
-                ],
-                'condition' => [
-                    "title!" => '',
-                ],
-                       ]
-        );
-
         $this->add_control(
                        'body',
                        [
@@ -131,7 +117,27 @@ class TextBlock extends Widget_Base {
             ]
         );
 
-                
+        $this->add_control(
+            'padding_top',
+            [
+                'label' => __('Disable padding top', 'cube'),
+                'type' => Controls_Manager::SWITCHER,
+                'default' => '',
+                'return_value' => 'pt0',
+                'prefix_class' => '',
+            ]
+        );
+
+        $this->add_control(
+            'padding_bottom',
+            [
+                'label' => __('Disable padding bottom', 'cube'),
+                'type' => Controls_Manager::SWITCHER,
+                'default' => '',
+                'return_value' => 'pb0',
+                'prefix_class' => '',
+            ]
+        );
 
         $this->add_control(
                        'title_size',
index 8d537b4cbd67c48c8ad5bd1e4d1a364e12e6a0a2..08ff15c59dae6614ca7bbe6ca6726553d32892a2 100644 (file)
@@ -19,7 +19,7 @@ html
   box-sizing: inherit
 
 body
-  background-color: #eee
+  background-color: #fff
   color: $colors.text
   font-family: $font
   line-height: 1.6
@@ -28,9 +28,9 @@ body
   min-width: 320px
 
 // Main content wrapper - constrain on larger screens
-.main
-  center()
-  background-color: #fff
+//.main
+//  center()
+//  background-color: #fff
 
 // Paragraph spacing
 p:not(:last-of-type)
index 588f2ce1c76c7b5e6543c16cc78ccdc1b9be8f1f..5a0d4ea90335052df9165fb0effebd3574f3b76b 100644 (file)
@@ -5,7 +5,10 @@
   padding-top: 0 !important
   padding-bottom: 0 !important
 
-.pt0
+.pt0,
+.pt0 > .elementor-widget-container
   padding-top: 0 !important
-.pb0
+
+.pb0,
+.pb0 > .elementor-widget-container
   padding-bottom: 0 !important
index 335c20dce38070f35565a67476bd6cce64025181..7dc164eec059d15972130ccd20201358269d6fe9 100644 (file)
@@ -1,15 +1,19 @@
 .heading
   position: relative
+  horizontal-spacing(7.5vw)
+  font-size: $font-size-extra-large // Size for title + used for positioning subtitle
+
+  &-subtitle-wrapper
+    position: absolute
+    top: 0.93em // This moves the text down the height of ~1 character from the title
+    left: 0
 
   &-subtitle
     writing-mode: vertical-lr
     transform: rotate(180deg)
     text-orientation: sideways
     margin: 0
-    position: absolute
     transform-origin: top right
-    top: 5.5em
-    left: -5em
     border-left: 2px solid
     padding-left: 0.25em
     text-transform: uppercase
@@ -17,4 +21,7 @@
     color: $colors.orange
 
   &-title
-    font-weight: 700
\ No newline at end of file
+    // Use the font size from the parent, which is also used to help with positioning
+    font-size: inherit
+    font-weight: 700
+    margin-bottom: 0
index 64d255bdca81cfcd8aa3e06737b41744314876c8..cef1902f4e2cf6a086147aaf888e12bd2e8c6eb3 100644 (file)
@@ -2,15 +2,14 @@
 // Padding is applied here so it can be overridden by Elementor
 .elementor-widget-cube-text .elementor-widget-container
   center(480px)
-  constrain(padding-left, 5vw)
-  constrain(padding-right, 5vw)
+  horizontal-spacing(5vw)
+  vertical-spacing(10vw)
   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)
 
-
 .text-block
 
   &-subtitle