S
SolidJS4mo ago
gsoutz

How do I apply Css only for certain routes and then unload the effects on other routes

ok
4 Replies
Raqueebuddin Aziz
There is no unloading a css file. Once it's loaded the only way to unload it is to refresh the page. Instead you should split the classes and apply them to the routes selectively What you can do is also overwrite the older stylesheet with a new one but it's not the best approach
gsoutz
gsoutz4mo ago
look there is a variable --main-max-width which is applied to top element, which changes value in different pages
skrebbel
skrebbel4mo ago
you can't ever unload css, so you gotta define the css such that it's correct for all pages. for example, make each page have a different class on the top level element, and set the variable in each class instead of on the root.
gsoutz
gsoutz4mo ago
why would i go into that trouble, is this standard practice for single page apps. is there a guide principles where i can read onto also how do i do that in tsx, like top level element is defined on top level layout each page is embedded inside a route, that can't access the top level
Want results from more Discord servers?
Add your server
More Posts
Can anyone tell me how best to do it? Store API``` import axios from "axios"; import {ErrorApi} from "~/utils/tryCallApi"; import {IBaseResponse, UExport Vercel Functions config on @solidjs/start@0.5.9Hello ! I've managed to update my `0.3.0` project to `0.5.9` by scooping info here and there on the How do I upgrade a solid-start project to use the latest version of solid-startI found a project that uses solid-start and actually has a working PWA. But it is from february 2023React is not defined when using custom server directory for ViteHi! If I use custom directory on the same level as `src` for dev mode in Vite & Solid setup, I get `solid-router without SSR and without having to redirectI just found out that when i build my app with solid-router its only possible to visit the index pagPortals in nested routes not rendering in consistent orderCheck out this stackblitz: https://stackblitz.com/edit/solidjs-templates-wwykia Loading `/one/two/thHow do I use solid router in the solid playground?I added solid router to the importmap, but whenever trying to import something it says “Cannot find how to make two-way data transfer through components?I need to pass a value from a child component to a parent component and back again and idk how to maIs createRouteAction removed ? Or Replaced ?Hi, I just updated my version of solid-start and cannot find `createRouteAction` in the docs. Can anPassing "up" signals in SolidI am trying to understand how can you go by reading values from signals defined in children componen