Skip to content

Commit

Permalink
Replaced .label with .tags
Browse files Browse the repository at this point in the history
It will be less confusing when trying to make future changes. I have also added the BEM classes to the current elements using the tags.
  • Loading branch information
lucascumsille committed Jan 13, 2025
1 parent 32bd74d commit 2a0ea75
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion www/docs/style/sass/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ form {
@import "parts/panels";
@import "parts/promo-banner";
@import "parts/accordion";
@import "parts/labels";
@import "parts/tags";

@import "pages/mp";
@import "pages/topics";
Expand Down
15 changes: 15 additions & 0 deletions www/docs/style/sass/pages/_alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -499,3 +499,18 @@
font-weight: 400;
}
}

.keyword-alert-accordion__tag,
.keyword-list__tag {
@extend .tag;
}

.keyword-alert-accordion__tag--included,
.keyword-list__tag--included {
@extend .tag--primary-light;
}

.keyword-alert-accordion__tag--excluded,
.keyword-list__tag--excluded {
@extend .tag--red;
}
17 changes: 0 additions & 17 deletions www/docs/style/sass/parts/_labels.scss

This file was deleted.

10 changes: 5 additions & 5 deletions www/includes/easyparliament/templates/html/alert/_alert_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<ul>
<?php foreach ($keywords as $word) {
if (!in_array($word, $skip_keyword_terms)) { ?>
<li class="label label--primary-light"><?= _htmlspecialchars($word) ?>
<li class="keyword-list__tag keyword-list__tag--included"><?= _htmlspecialchars($word) ?>
<?php }
} ?>
</ul>
Expand Down Expand Up @@ -220,7 +220,7 @@
<?php } ?>
<ul>
<?php foreach ($keywords as $word) { ?>
<li class="label label--primary-light"><?= _htmlspecialchars($word) ?>
<li class="keyword-list__tag keyword-list__tag--included"><?= _htmlspecialchars($word) ?>
<?php } ?>
</ul>
</div>
Expand All @@ -230,7 +230,7 @@
<h3><?= gettext('Unless the speech also includes these words') ?>:</h3>
<ul>
<?php foreach (explode(" ", $exclusions) as $word) { ?>
<li class="label label--red"><?= _htmlspecialchars($word) ?>
<li class="keyword-list__tag keyword-list__tag--excluded"><?= _htmlspecialchars($word) ?>
<?php } ?>
</ul>
</div>
Expand All @@ -241,7 +241,7 @@
<h3><?= gettext('And only if the speech is in') ?>:</h3>
<ul>
<?php foreach ($sections as $word) { ?>
<li class="label label--primary-light"><?= _htmlspecialchars($word) ?>
<li class="keyword-list__tag keyword-list__tag--included"><?= _htmlspecialchars($word) ?>
<?php } ?>
</ul>
<?php } else { ?>
Expand All @@ -254,7 +254,7 @@
<h3><?= gettext('And only when spoken by') ?></h3>
<ul>
<?php foreach ($members as $member) { ?>
<li class="label label--primary-light"><?= $member['given_name'] ?> <?= $member['family_name'] ?>
<li class="keyword-list__tag keyword-list__tag--included"><?= $member['given_name'] ?> <?= $member['family_name'] ?>
<?php } ?>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<h3 class="heading-with-bold-word">Keywords <strong>included</strong> in this alert:</h3>
<ul>
<?php foreach ($alert["keywords"] as $keyword) { ?>
<li class="label label--primary-light"><?= _htmlspecialchars($keyword) ?>
<li class="keyword-alert-accordion__tag keyword-alert-accordion__tag--included"><?= _htmlspecialchars($keyword) ?>
<?php } ?>
</ul>
</div>
Expand All @@ -85,7 +85,7 @@
<h3 class="heading-with-bold-word">Keywords <strong>excluded</strong> in this alert:</h3>
<ul>
<?php foreach ($alert["exclusions"] as $exclusion) { ?>
<li class="label label--red"><?= _htmlspecialchars($exclusion) ?>
<li class="keyword-alert-accordion__tag keyword-alert-accordion__tag--excluded"><?= _htmlspecialchars($exclusion) ?>
<?php } ?>
</ul>
</div>
Expand All @@ -96,7 +96,7 @@
<h3 class="heading-with-bold-word">Which <strong class="bold">section</strong> should this alert apply to:</h3>
<ul>
<?php foreach ($alert["sections_verbose"] as $section) { ?>
<li class="label label--primary-light"><?= _htmlspecialchars($section) ?>
<li class="keyword-alert-accordion__tag keyword-alert-accordion__tag--included"><?= _htmlspecialchars($section) ?>
<?php } ?>
</ul>
</div>
Expand All @@ -107,7 +107,7 @@
<h3 class="heading-with-bold-word"><?= gettext('This alert applies to the following <strong class="bold">representative</span>') ?></h3>
<ul>
<?php foreach ($alert['spokenby'] as $speaker) { ?>
<li class="label label--primary-light"><?= $speaker ?>
<li class="keyword-alert-accordion__tag keyword-alert-accordion__tag--included"><?= $speaker ?>
<?php } ?>
</ul>
</div>
Expand Down

0 comments on commit 2a0ea75

Please sign in to comment.