feat: restyle unauthenticated screens #1103
|
@ -50,6 +50,10 @@ const motd = computed(() => store.state.config.motd)
|
|||
border-radius: $radius;
|
||||
box-shadow: var(--shadow-md);
|
||||
overflow: hidden;
|
||||
konrad marked this conversation as resolved
Outdated
|
||||
|
||||
@media screen and (max-width: $desktop) {
|
||||
konrad marked this conversation as resolved
Outdated
dpschen
commented
Use mobile first:
=> no need to reset the border-radius for mobile Use mobile first:
```scss
@media screen and (min-width: $desktop) {
border-radius: $radius;
}
```
=> no need to reset the border-radius for mobile
|
||||
border-radius: 0;
|
||||
konrad marked this conversation as resolved
Outdated
dpschen
commented
Just checked this: The llama is so nice, it's too bad it's not visivle on mobile. How about adding a padding-bottom for mobile? Just checked this: The llama is so nice, it's too bad it's not visivle on mobile. How about adding a padding-bottom for mobile?
|
||||
}
|
||||
}
|
||||
|
||||
.image {
|
||||
|
@ -57,6 +61,14 @@ const motd = computed(() => store.state.config.motd)
|
|||
background: url('@/assets/no-auth-image.jpg') no-repeat bottom;
|
||||
konrad marked this conversation as resolved
Outdated
dpschen
commented
Use mobile first:
Compress image and load with something like https://github.com/JonasKruckenberg/imagetools Use mobile first:
```scss
.image {
@media screen and (max-width: $tablet) {
display: none;
}
@media screen and (min-width: $tablet) {
width: 40%;
background: url('@/assets/no-auth-image.jpg') no-repeat bottom/cover;
position: relative;
}
@media screen and (min-width: $desktop) {
width: 60%;
}
}
```
Compress image and load with something like https://github.com/JonasKruckenberg/imagetools
konrad
commented
With the vite wrapper and use it for other images as well? > Compress image and load with something like https://github.com/JonasKruckenberg/imagetools
With the vite wrapper and use it for other images as well?
dpschen
commented
Yes. But maybe let's move this to a new issue. Yes. But maybe let's move this to a new issue.
konrad
commented
yeah I think we should. yeah I think we should.
|
||||
background-size: cover;
|
||||
position: relative;
|
||||
|
||||
@media screen and (max-width: $desktop) {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
@media screen and (max-width: $tablet) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.overlay {
|
||||
konrad marked this conversation as resolved
dpschen
commented
Move these rules to the
Move media queries before If you change Move these rules to the `@media screen and (min-width: $tablet)` media query
=> makes it clearer that it just appies there.
```scss
width: 50%;
padding: 1rem;
display: flex;
flex-direction: column;
justify-content: flex-end;
&::after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, .2);
z-index: 10;
}
> * {
z-index: 20;
}
```
Move media queries before `&::after` and `> *`
=> those are styling other elements
=> move styles together that style the same stuff
If you change `&::after` in `&::before` you can remove the z-index if you replace
`z-index: 20;` with `position: relative` (this creates a new [stacking context](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context).
=> less complexity with managing z-index.
konrad
commented
Done! Done!
|
||||
|
@ -82,12 +94,16 @@ const motd = computed(() => store.state.config.motd)
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-direction: column;
|
||||
|
||||
@media screen and (max-width: $desktop) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.logo {
|
||||
dpschen marked this conversation as resolved
Outdated
dpschen
commented
On desktop: On desktop:
Maybe the logo should be not centered but left aligned with the content below.
=> Might make the Title easier to read because there is more room between those two headlines
konrad
commented
You mean aligned in the middle like this? You mean aligned in the middle like this?
konrad
commented
dpschen
commented
I'm also not really happy with this. Let's keep it for now how it is. I'm also not really happy with this. Let's keep it for now how it is.
|
||||
color: var(--logo-text-color);
|
||||
konrad marked this conversation as resolved
Outdated
dpschen
commented
Color seems to be applied twice (from inside the component aswell). Color seems to be applied twice (from inside the component aswell).
|
||||
max-width: 100%;
|
||||
margin-bottom: 1rem;
|
||||
margin: 1rem 0;
|
||||
konrad marked this conversation as resolved
Outdated
dpschen
commented
Picky: new css love: use Picky: new css love: use `margin-block: 1rem;` => transformed by postcss-preset-env. Reason: you don't want to define the inline (left, right) value, but do it here as a sideeffect.
konrad
commented
hmm it looks like this isn't transformed. But it definitely is a nice propery. hmm it looks like this isn't transformed. But it definitely is a nice propery.
dpschen
commented
I checked this again. I think that the browsers that we want to support according to our browserslist all support it natively so there is no need for postcss-preset-env to transform it =) Because it does do that via postcss-logical I checked this again.
I think that the browsers that we want to support according to our browserslist all support it natively so there is no need for postcss-preset-env to transform it =)
Because it does do that via [postcss-logical](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical)
|
||||
}
|
||||
|
||||
.message {
|
||||
konrad marked this conversation as resolved
Outdated
dpschen
commented
Add class to Message component and use that. Add class to Message component and use that.
=> By using a class inside the component we would create an implicit dependency.
konrad
commented
It looks like the class here wasn't used anywhere. I've removed it. It looks like the class here wasn't used anywhere. I've removed it.
dpschen
commented
Use mobile first:
Use mobile first:
```scss
.content {
// start with common stuff
display: flex;
justify-content: space-between;
flex-direction: column;
padding: 2rem 2rem 1.5rem;
// define stuff that applies mobile only
@media screen and (max-width: $desktop) {
width: 100%;
max-width: 450px;
margin-inline: auto;
}
// define desktop only stuff
@media screen and (min-width: $desktop) {
width: 50%;
}
}
```
konrad
commented
Done! Done!
|
||||
|
|
Why overflow: hidden?
To prevent the background from overflowing in the (rounded) corners.