This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ability to set
<main>
class using route metadata
no issue - modified `ui` service's `routeDidChange` handler to update it's `mainClass` property based on the new route's metadata - used in the future for switching screen background colours To use the feature, modify or add a `buildRouteInfoMetadata` hook in the route which you'd like to change, eg: ```js export default AuthenticatedRoute.extend({ ... buildRouteInfoMetadata() { return { bodyClasses: ['my-body-class'], mainClasses: ['grey-bg'] // <-------- }; } }); ``` The route hierarchy is taken into consideration with classes being added for all currently shown routes. For example if you wanted to add an `editor` class to all editor routes you could use the hook in `routes/editor.js` then if you added an `editor-new` class in `routes/editor/new.js` the resulting HTML output on the "New story" screen would be: ```html <main class="gh-main editor editor-new"> ```
- Loading branch information