-
Notifications
You must be signed in to change notification settings - Fork 10
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
Variables for spacing values used for spacing mixins #286
Conversation
@danalvrz @steffenri Can I have also a review from you both? thanks! |
src/theme/blocks/_image.scss
Outdated
@@ -157,7 +157,7 @@ figure { | |||
|
|||
// image/video captions | |||
figcaption { | |||
margin: 25px 0 0 0; | |||
margin: $block-vertical-space 0 0 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.
This also makes no sense. the figcaption margins are not controlling space between blocks but inside the block itself. Please keep the numeric values 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.
@steffenri I disagree that the figcaption is controlling space within itself. that would be a job for padding.
The margin is used to give some spacing from the section to the element above it.
To me this is clear that it's a job for a generic vertical-space unit that isn't called block therefore
triggering the idea that it is placed on wrong elements given the fact that there are several
mixins and variables that use the naming vertical-space or spacing
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.
@ichim-david The value in there is not generic, nor tied to the generic vertical spacing. It's tied to the figcaption, and it has intrinsic properties, defining the figcaption and how it behaves with its soroundings. If I change the generic one, I most probably don't want to change this.
@sneridagh @ichim-david I added a few comments. Otherwise it looks good to me. We have to be REALLY careful with what we use variables for and what not. The key is to use variables for things that belong together when we change the variable. For example when we change the block spacing variable, it should change the block spacing on every block but nothing else. |
@steffenri thank you for your review, I understand your concern for having a variable named $block-vertical-space used on content types. Questions:
I assume no, and I am curious about your thinking, if you were to be given volto-light-theme to make a website how much flexibility in values would you like to have and what sections do you think it's normal to be static values that you assume you simply need to write CSS overrides. @sneridagh @steffenri If you think and you give me a set of guidelines on what is acceptable to be pluggable in your styling I will make sure that my pull requests will be on those aspects and not something else. |
I think @steffenri has a point in here. Regarding directives to use, I'd say we can't stablish one... also, we don't have the development power not the vision of a theming library like bootstrap or others. So I'd say that we should go with the flow, improve on the go, don't go for early optimizations actions if they do not make sense today, because it could bite us in the future. @ichim-david using common vars are ok, but there is a compromise if things are not really generic. Also, let's assume that when CSS applies, everybody has its own way and do things following what's on your own book. There's nothing in IT more opinionated as doing CSS. And, as I said before, any of us are not Mark Otto... and the community does not have such a profile. So let's assume this fact and go with the best we have. At the end, adding a var or not, or using a declaration or another, is only one CSS override away in the cascade... |
I will see if I can find any similarity between the content as to why the value for the block-vertical-space is used. |
…it's initial purpose
@sneridagh @steffenri I have removed any extra changes I've made in order to keep this pull request pure sticking to the title of the pull request. I believe we need a vertical-space variable that uses the 25px that can be used just like the $block-vertical-space where you need to have this 25px value. This is why I was asking you @steffenri for a naming suggestion so that we can apply it where we deal with vertical spacing margins. If you have a name you desire I volunteer to add another pull request and ensure the 25px margins are using that variable. |
That rule has a reasoning. |
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.
@steffenri could you give it another try?
@sneridagh @ichim-david This looks good now. Can be merged IMO. |
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.
Looks good! thanks @ichim-david!
No description provided.