Skip to content

Commit 03b09ab

Browse files
committed
feat(micro-journeys): add theme consumer to interactive-step; lint scss
1 parent b95aa72 commit 03b09ab

File tree

2 files changed

+18
-59
lines changed

2 files changed

+18
-59
lines changed

packages/micro-journeys/src/interactive-step.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
import { props, define, hasNativeShadowDomSupport } from '@bolt/core/utils';
1+
import {
2+
props,
3+
define,
4+
hasNativeShadowDomSupport,
5+
withContext,
6+
} from '@bolt/core/utils';
27
import { withLitHtml, html, convertSchemaToProps } from '@bolt/core';
38
import { triggerAnims } from '@bolt/components-animate/utils';
49
import classNames from 'classnames/bind';
10+
import { BoltInteractivePathwaysContext } from './interactive-pathways';
511
import styles from './interactive-step.scss';
612
import schema from './interactive-step.schema';
713

814
const cx = classNames.bind(styles);
915

1016
@define
11-
class BoltInteractiveStep extends withLitHtml() {
17+
class BoltInteractiveStep extends withContext(withLitHtml()) {
1218
static is = 'bolt-interactive-step';
1319

1420
static props = {
@@ -19,6 +25,10 @@ class BoltInteractiveStep extends withLitHtml() {
1925
...convertSchemaToProps(schema),
2026
};
2127

28+
static get consumes() {
29+
return [[BoltInteractivePathwaysContext, 'theme']];
30+
}
31+
2232
// https://github.com/WebReflection/document-register-element#upgrading-the-constructor-context
2333
constructor(self) {
2434
self = super(self);
@@ -122,6 +132,7 @@ class BoltInteractiveStep extends withLitHtml() {
122132
render() {
123133
// validate the original prop data passed along -- returns back the validated data w/ added default values
124134
const { tabTitle } = this.validateProps(this.props);
135+
this.theme = this.context.theme;
125136
const isLastStep = !(
126137
this.nextElementSibling &&
127138
this.nextElementSibling.tagName.toLowerCase() === 'bolt-interactive-step'
@@ -136,6 +147,7 @@ class BoltInteractiveStep extends withLitHtml() {
136147
[`c-bolt-interactive-step--active`]: this._isActiveStep,
137148
[`c-bolt-interactive-step--first`]: isFirstStep,
138149
[`c-bolt-interactive-step--last`]: isLastStep,
150+
[`t-bolt-${this.theme}`]: this.theme,
139151
});
140152

141153
const titleClasses = cx('c-bolt-interactive-step__title');

packages/micro-journeys/src/nav-shared.scss

Lines changed: 4 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
$header-text-size: 1rem;
22
$header-text-line-height: 1.65;
3-
// @todo: switch to 20px when enabling consolidated / animated dot styles
43
$nav-circle-size: 12px;
54
$nav-circle-size--active: 14px;
65
$nav-circle-border-size: 2px;
@@ -10,29 +9,16 @@ $nav-circle-border-size: 2px;
109
width: $nav-circle-size--active;
1110
height: $nav-circle-size--active;
1211
margin-left: -$nav-circle-size--active / 2 - $nav-circle-border-size;
13-
<<<<<<< HEAD
1412
border: $nav-circle-border-size solid bolt-theme(primary);
1513
// @TODO there's no good way to match the comps here given we can't know what theme we're in b/c shadow dom.
16-
background-color: bolt-theme(secondary);
17-
=======
18-
border: $nav-circle-border-size solid;
19-
border-color: bolt-theme(
20-
(
21-
xdark: secondary,
22-
dark: secondary,
23-
light: primary,
24-
xlight: primary,
25-
)
26-
);
2714
background-color: bolt-theme(
2815
(
29-
xdark: primary,
30-
dark: primary,
31-
light: secondary,
32-
xlight: secondary,
16+
xdark: primary 1,
17+
dark: primary 1,
18+
light: secondary 1,
19+
xlight: secondary 1
3320
)
3421
);
35-
>>>>>>> 946d6c934... fix: update Sass to use bolt-theme outside of a media query + add border color to styles
3622
}
3723

3824
@else {
@@ -47,45 +33,6 @@ $nav-circle-border-size: 2px;
4733
border-radius: 50%;
4834
background-color: bolt-theme(primary);
4935
}
50-
51-
// @todo: enable animated dot + more consolidated styles
52-
// @if $active {
53-
// transform: translateX(-50%) scale(0.85);
54-
// border: $nav-circle-border-size solid;
55-
// border-color: bolt-theme(
56-
// (
57-
// xdark: secondary,
58-
// dark: secondary,
59-
// light: primary,
60-
// xlight: primary,
61-
// )
62-
// );
63-
// background-color: bolt-theme(
64-
// (
65-
// xdark: primary,
66-
// dark: primary,
67-
// light: secondary,
68-
// xlight: secondary,
69-
// )
70-
// );
71-
// }
72-
73-
// @else {
74-
// content: '';
75-
// display: inline-block;
76-
// box-sizing: content-box;
77-
// transform: translateX(-50%) scale(0.5);
78-
// z-index: 1;
79-
// width: $nav-circle-size;
80-
// height: $nav-circle-size;
81-
// margin-right: bolt-spacing(small);
82-
// border-radius: 50%;
83-
// border-width: 2px;
84-
// border-style: solid;
85-
// border-color: transparent;
86-
// background-color: bolt-theme(primary);
87-
// transition: all 0.2s ease;
88-
// }
8936
}
9037

9138
@mixin bolt-micro-journeys-nav-line() {

0 commit comments

Comments
 (0)