Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix link and text selection in budget header #4825

Merged
merged 1 commit into from
May 4, 2022

Conversation

javierm
Copy link
Member

@javierm javierm commented May 3, 2022

References

Visual Changes

Before these changes

The mouse cursor stays being the default cursor when trying to select the text in the budget header

After these changes

The text in the budget header can be selected and the mouse cursor changes accordingly

Notes

While reviewing commit 7702b55, I forgot to test whether selecting text in the budget header and clicking its link worked properly.

The negative index (-5) meant it was impossible to select its text or click on its link.

The good news is the pseudoelement with a negative index (-1) is considered a child of the .budget-header element, so having a negative index will cause the pseudoelement to be render behind the content of the .budget-header element but in front of the background of the .budget-header element.

This is exactly what we want.

Originally, we didn't have a z-index in the .budget-header element, meaning the pseudoelement was rendered behind the background of the .budget-header element, meaning both backgrounds were visible. This was OK when the background was a plain color, but it wasn't when the background was an image.

To stress the fact that the budget header is only affected when we use an image, I'm also moving the code inside the .with-background-image selector, although it would be interesting to check whether it's a good idea to add z-index: 0 to the full-width-background mixin.

@javierm javierm added the Bug label May 3, 2022
@javierm javierm added this to Reviewing in Consul Democracy via automation May 3, 2022
@javierm javierm self-assigned this May 3, 2022
@javierm javierm changed the title Fix selecting text in budget header Fix link and text in budget header May 3, 2022
@javierm javierm changed the title Fix link and text in budget header Fix link and text selection in budget header May 3, 2022
@javierm javierm force-pushed the fix_selecting_text_in_budget_header branch from b41f0e8 to 25ba7fb Compare May 3, 2022 18:57
While reviewing commit 7702b55, I forgot to test whether selecting
text in the budget header or clicking its link worked properly.

The negative index (-5) meant it was impossible to select its text or
click on its link.

The good news is the pseudoelement with a negative index (-1) is
considered a child of the .budget-header element, so having a negative
index will cause the pseudoelement to be render behind the content of
the .budget-header element but in front of the background of the
.budget-header element.

This is exactly what we want.

Originally, we didn't have a z-index in the .budget-header element,
meaning the pseudoelement was rendered behind the background of the
.budget-header element, meaning both backgrounds were visible. This was
OK when the background was a plain color, but it wasn't when the
background was an image.

To stress the fact that the budget header is only affected when we use
an image, I'm also moving the code inside the `.with-background-image`
selector, although it would be interesting to check whether it's a good
idea to add `z-index: 0` to the `full-width-background` mixin.
@javierm javierm force-pushed the fix_selecting_text_in_budget_header branch from 25ba7fb to bfe6c18 Compare May 3, 2022 19:00
@taitus taitus self-assigned this May 4, 2022
Consul Democracy automation moved this from Reviewing to Testing May 4, 2022
@taitus taitus merged commit e18f85a into master May 4, 2022
@taitus taitus deleted the fix_selecting_text_in_budget_header branch May 4, 2022 07:43
Consul Democracy automation moved this from Testing to Release 1.5.0 May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants