-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the unused format prop from ToggleSwitch (#1732)
## What are you changing? - Remove the unused `format` prop from the `ToggleSwitch` component in `@guardian/source-development-kitchen` ## Why? The optional format prop is never used anywhere in the Guardian organisation, implying it is redundant. The component doesn't really do a lot with the format. If a `format` is set, the element gets a slightly different colour palette, but we aren't checking the value of the prop `format`, just whether or not it exists. At best this is overly complex. **Without format:** <img width="279" alt="Screenshot 2024-10-09 at 12 32 52" src="https://github.com/user-attachments/assets/5c8cf409-4619-485a-a006-0eff936cd16f"> **With format:** <img width="380" alt="Screenshot 2024-10-09 at 12 32 43" src="https://github.com/user-attachments/assets/3cd11261-ba5e-4e88-99c4-1509b2899295"> Note: background colour doesn't get applied automatically, this must be manually added to the containing element If we decide we want to keep the alternative colours, we can do so using a flag rather than a `format` prop e.g. `altColourScheme: boolean`. But it should be noted that this alternative colour scheme [is not reflected in the Design System](https://www.figma.com/design/FnCwHWaXPUsyjE0luiI03e/%E2%97%89-Cheat-sheet?m=auto&node-id=2437-73573&t=YGnpuBQPWo6cJ8rR-1).
- Loading branch information
Showing
4 changed files
with
71 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@guardian/source-development-kitchen': major | ||
--- | ||
|
||
Remove `format` prop from `ToggleSwitch` component. | ||
|
||
It was not being used anyway. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters