Skip to content

Commit

Permalink
Merge pull request #8289 from cfpb/ans_ask_tidy
Browse files Browse the repository at this point in the history
Ask CFPB: Remove `inset-row`, `video_player-row`, `content_sidebar`
  • Loading branch information
anselmbradford authored Apr 4, 2024
2 parents 0759c7b + cfe007e commit cb79e05
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 26 deletions.
2 changes: 1 addition & 1 deletion cfgov/ask_cfpb/jinja2/ask-cfpb/ask-answer-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{% for block in value %}
{% set after_tip = value[loop.index - 2].block_type == 'tip' if loop.index > 1 else False %}
{% if not after_tip %}
<div class="row {{'inset-row' if block.block_type == 'tip' else block.block_type~'-row'}}"
<div class="row"
{% if block.value.anchor_tag %}
id="{{ block.value.anchor_tag }}"
{% endif %}>
Expand Down
8 changes: 4 additions & 4 deletions cfgov/ask_cfpb/tests/test_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_content_block_applies_wrapper_to_tip(self):
block = AskAnswerContent()
value = block.to_python([self.tip_data])
html = block.render(value)
expected_html = '<div class="inset-row row">{}</div>'.format(
expected_html = '<div class="row">{}</div>'.format(
self.expected_tip_html
)
self.assertHTMLEqual(html, expected_html)
Expand All @@ -36,7 +36,7 @@ def test_content_block_applies_wrapper_to_tip_and_next_block(self):
block = AskAnswerContent()
value = block.to_python([self.tip_data, self.text_data])
html = block.render(value)
expected_html = '<div class="inset-row row">{}{}</div>'.format(
expected_html = '<div class="row">{}{}</div>'.format(
self.expected_tip_html, self.expected_text_html
)
self.assertHTMLEqual(html, expected_html)
Expand All @@ -45,10 +45,10 @@ def test_content_block_does_not_apply_wrapper_without_tip(self):
block = AskAnswerContent()
value = block.to_python([self.text_data])
html = block.render(value)
expected_html = '<div class="text-row row">{}</div>'.format(
expected_html = '<div class="row">{}</div>'.format(
self.expected_text_html
)
self.assertNotIn('<div class="inset-row row">', html)
self.assertNotIn('<div class="row">', html)
self.assertHTMLEqual(html, expected_html)


Expand Down
24 changes: 3 additions & 21 deletions cfgov/unprocessed/css/on-demand/ask.less
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,6 @@
max-width: 41.875rem;
}

.respond-to-min(@bp-lg-min, {
.content_sidebar {
padding-top: 0;
}
});

.o-expandable_cue-close {
display: none;
}

.answer-text {
h2,
h3,
Expand All @@ -148,7 +138,6 @@
margin-top: unit(@grid_gutter-width / 2 / @base-font-size-px, em);
}

.video_player-row + .row,
.row + .row > .o-table:first-child,
.row + .row > .o-video-player:first-child {
margin-top: unit(@grid_gutter-width / @base-font-size-px, em);
Expand All @@ -162,27 +151,20 @@
margin-top: unit(@grid_gutter-width / @size-iii, em);
}

.row + .row:not(.inset-row) h4 {
.row + .row h4 {
margin-top: unit(@grid_gutter-width / @size-iv, em);
}

// Large desktop size.
.respond-to-min(@bp-lg-min, {
.row + .row h2 {
margin-top: unit( @grid_gutter-width * 1.5 / @size-ii, em );
}
});
}

// Mobile only.
.respond-to-max(@bp-xs-max, {
.inset-row {
display: flex;
flex-direction: column-reverse;

.m-inset {
margin-top: unit( @grid_gutter-width / @base-font-size-px, em );
}
}

.related-questions {
margin: unit( @grid_gutter-width / @base-font-size-px, em ) 0;
}
Expand Down

0 comments on commit cb79e05

Please sign in to comment.