// Elementor interface icon
public function get_icon() {
- return 'eicon-align-left';
+ return 'eicon-heading';
}
// Where to display the widget in the Elementor interface
$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>';
}
/**
]
);
- $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',
[
]
);
-
+ $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',
box-sizing: inherit
body
- background-color: #eee
+ background-color: #fff
color: $colors.text
font-family: $font
line-height: 1.6
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)
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
.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
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
// 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