-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor modal content (fixes #291 and @292) #324
Conversation
</v-card-actions> | ||
</v-row> | ||
<v-card-title class="container-title unified-padding"> | ||
<h1>{{ selectedProject.name }}</h1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is possible to give it a class, that way we remain a flat hierarchy of selectors. Or if styles for headings can be used also in other components you can reconsider moving it to global styles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given our discussion of h1 tags we should decide whether using h1 here is appropriate at all. Whatever the class should be, I wouldn't argue moving it, at least in part, to the global class. Will keep you posted on the adjustments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final changes:
- I removed h1 tag to reserve it for singular use only - although multiple h1 tags don't matter anymore in html 5, because web crawlers use sections to understand the structure in more modular way (e.g. Google) people still believe that it is the best practice. Basically the argument is that with the singular use you don't lose anything but you may gain sth in particular cases.
- So I used h2 and h3 tags instead - both went to global classes with some local override for the main title.
<h1>{{ selectedProject.name }}</h1> | ||
<div> | ||
<v-btn class="hidden-xs-only" rounded icon large @click="onClick()"> | ||
<v-icon size="3.5rem" color="white">close</v-icon> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be better to pass it as some variables not hardcoded like that, if not pass color as hex (#ffffff) not white
you can try this approach:
https://stackoverflow.com/a/61378302
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. so the options in the link regard the situation when I actually want to change sth about default vuetify settings. Given that I realize how fucked up it is to have part of the styling through vuetify props and others through regular classes is there actually a reason to try to overwrite that? I mean veutfy is what it is, but isn't it overkill to write css just to override the default settings to the same effect? Please straight me out if I'm wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final changes:
- I dropped v-btn and v-icon altogether (in this case vuetify does more harm than good)
- I created global classes for two kinds of buttons which use globally defined colors
<v-card-actions class="buttons-list unified-padding"> | ||
<div v-show="selectedProject.licensePage !== ''"> | ||
<v-btn text rounded :href="selectedProject.licensePage" target="_blank"> | ||
<v-icon>far fa-copyright</v-icon> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not to use https://vuetifyjs.com/en/features/icons/#using-custom-icons and create component with icons? this way you write it once and then use it in a whole project
also I'd add some accessibility here like aria-label
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems awsome. I'll try to implement that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final changes:
Global store for icons seems to be a really good idea but when I started playing with it both through Vuetify and Font Awsome I couldn't find the way that actually save code. To the contrary, it did introduce another layer of abstraction which doesn't seem that necessary at this point. For now I settled with the basic local use of FA with <i>
tag.
I still believe global store for icons is a good idea but I think it goes beyond the scope of this task to do it right. I will create a new issue for that.
</div> | ||
<div v-show="selectedProject.githubLink !== ''"> | ||
<v-btn text rounded :href="selectedProject.githubLink" target="_blank"> | ||
<v-icon>fab fa-github</v-icon> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
<v-card-text class="unified-padding"> | ||
<p class="text-center">{{ selectedProject.description }}</p> | ||
</v-card-text> | ||
<div v-show="countPartners >> 0"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is >>
it ok? not just >
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final changes:
You're right. For some reason webstorm was correcting me on a singular use, but actually it seems to work fine. FYI VSC doesn't claim that kind of problem :D
<v-col class="partner-item" cols="12" sm="3"> | ||
<v-btn class="buttons-chips" text :href="partners.link" rounded> | ||
<span class="buttons-text">Poznaj</span> | ||
<v-icon>fas fa-hands-helping</v-icon> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
h2 { | ||
font-family: $font-content; | ||
font-size: 1.5rem; | ||
color: black; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well... we didn't have global black defined :D I'll work on that => promise (I realize that promise isn't usually what you return in a function => just an inside joke :P )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final changes:
That's done
.buttons { | ||
margin: 1rem 0.5rem 1rem 0; | ||
.buttons-close { | ||
background-color: $blue !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is !important
needed? I guess you can add another class to the element and then you don't have to use such an overwriting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is the kind of moment when not using important results in nothing. So either I can use in-line prop where I cannot use $var and need to repeat $blue var's hex or can I use important to overrride whatever vuetify understands. I didn't figure out how to pass global $blue into html part of code. That's why this blasphemy is here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final changes:
I dropped v-btn altogether so that's not an issue no more
justify-content: center; | ||
text-align: center; | ||
@media only screen and (max-width: $phone) { | ||
padding: 2% 10%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not easy to predict how it will behave on different devices (resolutions), if you use rem I would stay with that, not mixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. However if it was you to consider some kind of understand what measure would you use? Is rem the best choice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final changes:
U used REMs both for desktop and mobile view
} | ||
|
||
.unified-padding { | ||
padding: 0.5rem 1.5rem !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above - add another class, !imporant
should be the laaaaaaaaaaast thing you can think about xd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really it was. I usually use !importnat when I feel helpless with vuetify :P However this change had been override and I will actually try to replace vuetify for clear vue in the whole component. We'll see if that's needed then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final changes:
I dropped using vuetify's v-card to style the container so it's not a problem anymore
Story / Bug id:
#291 and #292
Description:
It was easier for me conceptually to go through both those tickets at the same time. Most important changes incude:
Migrations:
I nested partner partners' attributes in the partner object, which is a list now.
New imports / dependencies:
N/A
What tests do I need to run to validate this change: