Skip to content

Commit

Permalink
convivial-bootstrap-32582: Replace the deicision tree implementation …
Browse files Browse the repository at this point in the history
…with opensource decision_tree_library.
  • Loading branch information
naveenvalecha committed May 22, 2023
1 parent 401d1db commit 631d9dd
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
1 change: 1 addition & 0 deletions base/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
@import "components/content-tabs/content-tabs";
@import "components/cta-link/cta-link";
@import "components/datatables/datatables";
@import "components/decision-tree/decision-tree";
@import "components/diff/diff";
@import "components/eu-cookie-compliance/eu-cookie-compliance";
@import "components/external-link/external-link";
Expand Down
41 changes: 41 additions & 0 deletions components/decision-tree/_decision-tree.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
*[class*='step__'] {
margin-top: 1.5rem;
}

.step__button--back {
margin-right: 0.5rem;
}

.decision-tree .step {
ul {
@extend .title;

padding: 0;
margin: 0;

li {
@extend .title__title;

padding: 0;
list-style: none;

+ li {
border-top: 0;
}
}

a {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.75rem 1rem;
text-decoration: none;
font-size: 1rem;
margin-top: 0rem;

&:hover, &:focus {
text-decoration: none;
}
}
}
}
10 changes: 7 additions & 3 deletions convivial_bootstrap.theme
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,6 @@ function convivial_bootstrap_preprocess_page(&$variables) {
$variables['attributes']['class'][] = trim($item['value']);
}
}
if ($node->getType() === 'decision_tree') {
$variables['#attached']['library'][] = 'convivial_bootstrap/decision_tree_library';
}
}

// Attach the library mark_external_links.
Expand Down Expand Up @@ -622,6 +619,13 @@ function convivial_bootstrap_preprocess_paragraph__geochart(&$variables) {
_convivial_bootstrap_geochart($variables);
}

/**
* Implements template_preprocess_paragraph__decision_tree().
*/
function convivial_bootstrap_preprocess_paragraph__decision_tree(&$variables) {
$variables['#attached']['library'][] = 'convivial_bootstrap/decision_tree_library';
}

/**
* Implements template_preprocess_ds_entity_view().
*/
Expand Down
2 changes: 1 addition & 1 deletion css/style.css

Large diffs are not rendered by default.

0 comments on commit 631d9dd

Please sign in to comment.