Is your feature request related to a problem? Please describe.
I asked this question on SO, but doesn't get much attentions.
I want to style the page differently in home and error page, but segment is undefined in both pagas.
Describe the solution you'd like
Either make segment return different values (e.g., "" vs undefined), or another variable saying if the current is error or not.
I lean toward the former.
How important is this feature to you?
Giving different layouts to home and error page layout is pretty common I think, and given there doesn't seem to be a workaround, I feel it's pretty important.
On a side note, the page store from @sapper/app may offer a (slightly hacky) workaround. That being said, the problem surely seems common enough to warrant a better solution. I鈥檇 go as far as to say _error.svelte should not inherit the common layout by default (we can still import and use it explicitly if we want to).
There鈥檚 a pull request https://github.com/sveltejs/sapper/pull/962
PR #1250 may be the solution to this. It separates the _layout styling from the _error styling.
$page.error is now available in 0.28.9.
Most helpful comment
$page.erroris now available in 0.28.9.