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

Move text direction styles #2777

Merged
merged 2 commits into from
May 15, 2023
Merged

Move text direction styles #2777

merged 2 commits into from
May 15, 2023

Conversation

jon-kirwan
Copy link
Contributor

@jon-kirwan jon-kirwan commented May 15, 2023

What

https://trello.com/c/fc41oyEK/1923-enable-individual-loading-of-stylesheets-in-government-frontend

Group document type text direction page styles in the application stylesheet as a pre-requisite to implementing the AssetHelper to load component and view style sheets only required on the page being viewed.

Why

  • Currently, text direction styles are in individual style sheets, for each document type, and often no more than around 4 or 5 lines of CSS (see below). These styles should be grouped together in the application style sheet alongside similar print styles
.speech {
  .direction-rtl & {
    direction: rtl;
    text-align: start;
  }
}
  • Also, in this case text compression increases the size of the asset. For example, for Case studies (_case-studies.css) from 132 bytes to 1.6 kb. Typically, this happens when the asset is very small and the overhead of the GZIP dictionary is higher than the compression savings, or when the resource is already well compressed. See https://web.dev/optimizing-content-efficiency-optimize-encoding-and-transfer/

Visual changes

None

Anything else

@govuk-ci govuk-ci had a problem deploying to government-frontend-pr-2777 May 15, 2023 10:08 Failure
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2777 May 15, 2023 10:09 Inactive
@jon-kirwan jon-kirwan changed the title Move rtl styles Move text direction styles May 15, 2023
@govuk-ci govuk-ci had a problem deploying to government-frontend-pr-2777 May 15, 2023 10:20 Failure
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2777 May 15, 2023 10:22 Inactive
@jon-kirwan jon-kirwan requested a review from MartinJJones May 15, 2023 11:26
Copy link
Contributor

@MartinJJones MartinJJones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nice work! 👍

@jon-kirwan jon-kirwan merged commit 7c6ba9d into main May 15, 2023
@jon-kirwan jon-kirwan deleted the move-rtl-styles branch May 15, 2023 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants