Skip to content

Commit d226202

Browse files
convivial-bootstrap-32582: Replace the deicision tree implementation with opensource decision_tree_library. (#24)
1 parent 401d1db commit d226202

File tree

4 files changed

+50
-4
lines changed

4 files changed

+50
-4
lines changed

base/scss/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
@import "components/content-tabs/content-tabs";
8383
@import "components/cta-link/cta-link";
8484
@import "components/datatables/datatables";
85+
@import "components/decision-tree/decision-tree";
8586
@import "components/diff/diff";
8687
@import "components/eu-cookie-compliance/eu-cookie-compliance";
8788
@import "components/external-link/external-link";
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
*[class*='step__'] {
2+
margin-top: 1.5rem;
3+
}
4+
5+
.step__button--back {
6+
margin-right: 0.5rem;
7+
}
8+
9+
.decision-tree .step {
10+
ul {
11+
@extend .title;
12+
13+
padding: 0;
14+
margin: 0;
15+
16+
li {
17+
@extend .title__title;
18+
19+
padding: 0;
20+
list-style: none;
21+
22+
+ li {
23+
border-top: 0;
24+
}
25+
}
26+
27+
a {
28+
display: flex;
29+
justify-content: space-between;
30+
align-items: center;
31+
padding: 0.75rem 1rem;
32+
text-decoration: none;
33+
font-size: 1rem;
34+
margin-top: 0rem;
35+
36+
&:hover, &:focus {
37+
text-decoration: none;
38+
}
39+
}
40+
}
41+
}

convivial_bootstrap.theme

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,6 @@ function convivial_bootstrap_preprocess_page(&$variables) {
185185
$variables['attributes']['class'][] = trim($item['value']);
186186
}
187187
}
188-
if ($node->getType() === 'decision_tree') {
189-
$variables['#attached']['library'][] = 'convivial_bootstrap/decision_tree_library';
190-
}
191188
}
192189

193190
// Attach the library mark_external_links.
@@ -622,6 +619,13 @@ function convivial_bootstrap_preprocess_paragraph__geochart(&$variables) {
622619
_convivial_bootstrap_geochart($variables);
623620
}
624621

622+
/**
623+
* Implements template_preprocess_paragraph__decision_tree().
624+
*/
625+
function convivial_bootstrap_preprocess_paragraph__decision_tree(&$variables) {
626+
$variables['#attached']['library'][] = 'convivial_bootstrap/decision_tree_library';
627+
}
628+
625629
/**
626630
* Implements template_preprocess_ds_entity_view().
627631
*/

css/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)