DEV: port full-width component to be included directly (#126)
Removes the [full-width component](https://github.com/discourse/discourse-full-width-component) dependency by adding most of the code directly to the theme. There was one grid definition in the CSS I ended up removing because it was conflicting with an existing override in the theme. Anyone who has previously installed the theme should manually remove the full-width component from it.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { apiInitializer } from "discourse/lib/api";
|
||||
|
||||
export default apiInitializer("0.8", (api) => {
|
||||
document.body.classList.add("full-width-enabled");
|
||||
|
||||
// When the sidebar is visible, force the HomeLogo to be in an 'un-minimized' state.
|
||||
api.registerValueTransformer?.(
|
||||
"home-logo-minimized",
|
||||
({ value, context }) => {
|
||||
if (value && context.showSidebar) {
|
||||
return false;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user