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

[83] Contextualise code view based on current navigator location #88

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

g-elwell
Copy link
Member

@g-elwell g-elwell commented Aug 8, 2024

Description

This PR updates the code preview to show only the styles currently being edited, rather than the entire theme config.

The router context is used to allow the code preview to change based on the current navigator location. In other words, when you click a block or element, you will only see the styles related to that item in the code preview area.

This makes it clearer which style changes are being applied. This change only impacts the code preview, the theme.json export is left untouched and will contain all data.

Related #83

Change Log

  • Contextualises code preview based on navigator location

Steps to test

  • Visit the themer settings page
  • Notice the code preview should only show existing site styles
  • Navigate to different elements - blocks, elements, elements nested inside blocks, pseudo-states, etc.
  • Notice the preview should update based on the location you navigate to
  • Check the preview reflects any changes in real time as you make them

Screenshots/Videos

Screen.Capture.on.2024-08-08.at.11-58-05.mp4

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@g-elwell g-elwell added the enhancement New feature or request label Aug 8, 2024
@g-elwell g-elwell self-assigned this Aug 8, 2024
@g-elwell g-elwell marked this pull request as ready for review August 8, 2024 11:00
Copy link
Contributor

@squarewave17 squarewave17 left a comment

Choose a reason for hiding this comment

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

Works great. Nice solution

@g-elwell g-elwell merged commit f24f39c into release/1.0.0 Aug 13, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants