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

Accessibility: replace padding values with logical properties #774

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

### Changed

- Replace physical properties with logical values - padding (#774)
- Sidebar - Refactored styles to be closer to designs (#720)
- Sidebar - Refactored theming to fix inconsistencies between themes (#720)
- Sidebar - Added hover styles to collapse and close buttons (#720)
Expand Down
2 changes: 1 addition & 1 deletion src/assets/stylesheets/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ body,
scrollbar-width: none; /* Remove scroll bar for Firefox */
}

// Remove scrollbar for Chrome, Safari and Opera
/* Remove scrollbar for Chrome, Safari and Opera */
::-webkit-scrollbar {
display: none;
}
10 changes: 5 additions & 5 deletions src/assets/stylesheets/AstroPiModel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
max-height: 50%;
min-height: 200px;
flex: 1;
padding-bottom: $space-0-5;
padding-block-end: $space-0-5;

canvas {
cursor: grab;
Expand Down Expand Up @@ -83,8 +83,8 @@
flex-flow: column;
align-items: center;
text-align: center;
padding: $space-0-5;
padding-top: $space-0-25;
padding-block: $space-0-25 $space-0-5;
padding-inline: $space-0-5;
box-sizing: border-box;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just checking but will padding: $space-0-5 apply padding to top, right, bottom and left; then padding-top adds an extra 0-25 to the top?

so would this need to be:

padding-inline: $space-0-5;
padding-block-end: $space-0-5;
padding-block-start: $space-0-75;

Copy link
Contributor

Choose a reason for hiding this comment

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

I replaced that with correct values, thank you for spotting it

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks Magda. Does padding-block: $space-0-25 $space-0-5; need to be padding-block: $space-0-75 $space-0-5;?

I think the original applies $space-05 to all sides, then an additional $space-0-25 to the top

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know where this $space-0-75 coming from? The original, as you mentioned, applies $space-05 to all sides and we have override the top with $space-0-25, which is the equivalent of padding-top: $space-0-25; padding-right: $space-0-5; padding-bottom: $space-0-5; padding-left: $space-0-5;
so it translates to padding-block: $space-0-25 $space-5; and padding-inline: $space-0-5;

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, perhaps I misunderstood. I didn't realise that padding-top overrides the padding: I thought it added to it!

border-radius: 5px;
width: 32%;
Expand Down Expand Up @@ -189,7 +189,7 @@
background-color: $rpf-grey-800;

&-controls {
border-top: 7px solid $rpf-grey-900;
border-block-start: 7px solid $rpf-grey-900;

&-panel {
&__control {
Expand Down Expand Up @@ -243,7 +243,7 @@
background-color: $rpf-white;

&-controls {
border-top: 5px solid $rpf-grey-100;
border-block-start: 5px solid $rpf-grey-100;

&-panel {
&__control {
Expand Down
5 changes: 2 additions & 3 deletions src/assets/stylesheets/BetaBanner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
.editor-banner__link {
display: inline;
font-weight: $font-weight-bold;
padding-left: 0;
padding-right: 0;
padding-inline: 0;
text-decoration: underline;

&.btn--tertiary {
Expand All @@ -46,7 +45,7 @@
}

.editor-banner__link--feedback {
padding-right: $space-0-25;
padding-inline-end: $space-0-25;
white-space: nowrap;
}

Expand Down
20 changes: 10 additions & 10 deletions src/assets/stylesheets/Dropdown.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use './rpf_design_system/spacing' as *;
@use './rpf_design_system/font-weight' as *;
@use './rpf_design_system/colours' as *;
@use "./rpf_design_system/spacing" as *;
@use "./rpf_design_system/font-weight" as *;
@use "./rpf_design_system/colours" as *;

.dropdown {
display: flex;
Expand All @@ -16,7 +16,7 @@
padding: 0 $space-1-5;

&--active {
border-bottom: 3px solid $rpf-teal-800;
border-block-end: 3px solid $rpf-teal-800;
}
}

Expand All @@ -33,13 +33,13 @@
&::before {
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-inline-start: 15px solid transparent;
border-inline-end: 15px solid transparent;
position: absolute;
inset-block-end: 100%;
inset-inline-start: 50%;
margin-inline-start: -15px;
content: '';
content: "";
}
}

Expand All @@ -52,7 +52,7 @@
color: inherit;
cursor: pointer;
font: inherit;
justify-content: left;
justify-content: inline-start;
font-weight: $font-weight-regular;
text-decoration: none;
padding: $space-0-5 $space-0-25;
Expand All @@ -79,7 +79,7 @@
background-color: $rpf-white;

&--bottom::before {
border-bottom: 15px solid $rpf-white;
border-block-end: 15px solid $rpf-white;
}

&--list__item:hover {
Expand All @@ -96,7 +96,7 @@
background-color: $rpf-grey-700;

&--bottom::before {
border-bottom: 15px solid $rpf-grey-700;
border-block-end: 15px solid $rpf-grey-700;
}

&--list__item:hover {
Expand Down
2 changes: 1 addition & 1 deletion src/assets/stylesheets/EditorPanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

.cm-content {
flex: 1;
padding-top: $space-0-5;
padding-block-start: $space-0-5;
margin-inline-end: $space-0-5;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/assets/stylesheets/FontSizeSelector.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
font-weight: $font-weight-bold;

svg {
padding-right: $space-0-5;
padding-inline-end: $space-0-5;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/assets/stylesheets/ImageUploadButton.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
}

.modal-footer {
text-align: right;
text-align: inline-end;
}
2 changes: 1 addition & 1 deletion src/assets/stylesheets/LandingPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
@media screen and (min-width: 768px) {
align-items: center;
display: flex;
text-align: left;
text-align: inline-start;
padding: 0 $space-2;
max-width: 634px;
}
Expand Down
16 changes: 8 additions & 8 deletions src/assets/stylesheets/MobileProject.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
height: $space-4;

&:last-of-type {
border-right: none;
border-inline-end: none;
}
}
}
Expand All @@ -49,33 +49,33 @@
.--dark {
.proj-container--mobile {
.runner-controls {
border-left: 1px solid $rpf-grey-600;
border-inline-start: 1px solid $rpf-grey-600;
}

.mobile-nav {
background-color: $rpf-grey-800;
border-top: 1px solid $rpf-grey-600;
border-block-start: 1px solid $rpf-grey-600;
}

.mobile-nav__menu {
border-right: 1px solid $rpf-grey-600;
border-inline-end: 1px solid $rpf-grey-600;
}
}
}

.--light {
.proj-container--mobile {
.runner-controls {
border-left: 1px solid $rpf-grey-150;
border-inline-start: 1px solid $rpf-grey-150;
}

.mobile-nav {
background-color: $rpf-off-white;
border-top: 1px solid $rpf-grey-150;
border-block-start: 1px solid $rpf-grey-150;
}

.mobile-nav__menu {
border-right: 1px solid $rpf-grey-150;
border-inline-end: 1px solid $rpf-grey-150;
}
}
}
Expand All @@ -85,7 +85,7 @@
#wc.--light,
#wc.--dark {
.mobile-nav {
border-bottom: none;
border-block-end: none;

.react-tabs__tab--selected {
background-color: inherit;
Expand Down
6 changes: 3 additions & 3 deletions src/assets/stylesheets/MobileProjectBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.mobile-project-bar {
background-color: $rpf-white;
border-top: 1px solid $rpf-grey-150;
border-block-start: 1px solid $rpf-grey-150;
display: flex;
height: 25px;
justify-content: space-between;
Expand All @@ -21,7 +21,7 @@
.--dark {
.mobile-project-bar {
background-color: $rpf-grey-800;
border-top: 1px solid $rpf-grey-600;
border-block-start: 1px solid $rpf-grey-600;
}

.mobile-project-bar__name {
Expand All @@ -32,7 +32,7 @@
.--light {
.mobile-project-bar {
background-color: $rpf-white;
border-top: 1px solid $rpf-grey-150;
border-block-start: 1px solid $rpf-grey-150;
}

.mobile-project-bar__name {
Expand Down
8 changes: 4 additions & 4 deletions src/assets/stylesheets/Modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@
}

.modal-content__header {
border-bottom: 1px solid $rpf-grey-500;
border-block-end: 1px solid $rpf-grey-500;
}

.modal-content__help-text {
color: $rpf-text-secondary-darkmode;
}

.modal-content__buttons {
border-top: 1px solid $rpf-grey-500;
border-block-start: 1px solid $rpf-grey-500;
}
}

Expand All @@ -193,14 +193,14 @@
}

.modal-content__header {
border-bottom: 1px solid $rpf-grey-150;
border-block-end: 1px solid $rpf-grey-150;
}

.modal-content__help-text {
color: $rpf-text-secondary;
}

.modal-content__buttons {
border-top: 1px solid $rpf-grey-150;
border-block-start: 1px solid $rpf-grey-150;
}
}
4 changes: 2 additions & 2 deletions src/assets/stylesheets/OutputViewToggle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
}

.--light .output-view-toggle {
border-left: 1px solid $rpf-grey-150;
border-inline-start: 1px solid $rpf-grey-150;
}

.--dark .output-view-toggle {
border-left: 1px solid $rpf-grey-600;
border-inline-start: 1px solid $rpf-grey-600;
}
8 changes: 3 additions & 5 deletions src/assets/stylesheets/Project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,19 @@
display: flex;
flex: 1 0 auto;
justify-content: space-between;
padding-left: 5px;
padding-right: 5px;
padding-inline: 5px;
}

.editor-controls {
display: flex;
}

.proj-controls {
padding-top: 20px;
padding-block-start: 20px;
}

.proj-share-link {
padding-left: 5px;
padding-right: 5px;
padding-inline: 5px;
}

.proj-container {
Expand Down
16 changes: 8 additions & 8 deletions src/assets/stylesheets/ProjectBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
}

.project-bar__btn-wrapper:not(:last-child) {
border-right: 1px solid $rpf-grey-150;
border-inline-end: 1px solid $rpf-grey-150;
}
}

Expand All @@ -79,19 +79,19 @@
border: 1px solid $rpf-grey-150;

.project-name {
border-right: 1px solid $rpf-grey-150;
border-inline-end: 1px solid $rpf-grey-150;
}
}

.project-bar__right {
border-left: 1px solid $rpf-grey-150;
border-inline-start: 1px solid $rpf-grey-150;

.rpf_button {
border-right: 1px solid $rpf-grey-150;
border-inline-end: 1px solid $rpf-grey-150;
}

.btn--tertiary::after {
border-right: 1px solid $rpf-grey-150;
border-inline-end: 1px solid $rpf-grey-150;
}

.btn--tertiary:focus-visible::after {
Expand All @@ -106,18 +106,18 @@
border: 1px solid $rpf-grey-600;

.project-name {
border-right: 1px solid $rpf-grey-600;
border-inline-end: 1px solid $rpf-grey-600;
}
}
.project-bar__right {
border-left: 1px solid $rpf-grey-600;
border-inline-start: 1px solid $rpf-grey-600;

.project-bar__btn-wrapper:not(:last-child) {
border-color: $rpf-grey-600;
}

.btn--tertiary::after {
border-right: 1px solid $rpf-grey-600;
border-inline-end: 1px solid $rpf-grey-600;
}

.btn--tertiary:focus-visible::after {
Expand Down
2 changes: 1 addition & 1 deletion src/assets/stylesheets/ProjectImages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
overflow-wrap: break-word;
word-break: break-word;
text-align: center;
vertical-align: top;
vertical-align: block-start;
}

&__image-wrapper {
Expand Down