Closed MickL closed 3 years ago
Hi @MickL, thanks again for your time! :)
If it's ok with you, let's make some changes please:
Nice touch about pointer-events
.
- revert modification from cols. Please let's try to keep grid output as low as possible for now. If this is requested by our community again, we can reconsider it then :)
Just to add my 2 cents, but I'd really like to see more column options as well! But you could consider adding a configuration setting like in bootstrap, if you don't want to unnecessarily bloat up the final css file:
https://github.com/twbs/bootstrap/blob/e79c8f3489527d7f5eef2bb3cf14856f26c49871/scss/_variables.scss#L332-L334 https://github.com/twbs/bootstrap/blob/e79c8f3489527d7f5eef2bb3cf14856f26c49871/scss/mixins/_grid.scss#L61
"But you could consider adding a configuration setting like in bootstrap" - wooow love it! :)
If you have time for this, please feel free to make a new PR, if not thanks for the idea, we'll do this.
Hey guys, will check tomorrow. Just so you know you can directly commit to this PR of you want.
Btw im not super happy that it seema to be required to have an extra col before row and col's
"it seema to be required to have an extra col before row and col's" - hmm, I don't think so. Or I don't get it, could you give an example please?
I mean that this works:
<div class="ph-item">
<div class="ph-col-12">
<div class="ph-row">
<div class="ph-col-2 empty"></div>
<div class="ph-col-8"></div>
<div class="ph-col-2 empty"></div>
</div>
</div>
</div>
</div>
But this does not:
<div class="ph-item">
<div class="ph-row">
<div class="ph-col-2 empty"></div>
<div class="ph-col-8"></div>
<div class="ph-col-2 empty"></div>
</div>
</div>
</div>
Or:
<div class="ph-row">
<div class="ph-col-2 empty"></div>
<div class="ph-col-8"></div>
<div class="ph-col-2 empty"></div>
</div>
</div>
-> There is always an extra ph-col required to wrap which is unnecessary.
Hi @MickL any news about code review, do you need some help?
About the wrapper. This PR resets the wrapper that still exists in our markup, so your solution includes it. I think removing wrapper would be breaking change, so it would be better to keep that in a separated new PR.
What do you think?
I didnt had time yet. Guess I will end up rewrite all this code for my project. I dont like that I need so many unnecessary wrappers. And I dont want to refactor all your code, I dont think that you will like it.
You can make changes to this PR directly so feel free to contribute and fix the things mentioned above.
Ok @MickL. Thank you very much for your time, contribution and ideas. Sure, I'll get back here in a few days with some changes and I hope you'll like it. Keep in touch. Have a great day.
Hey, so as I said I ended up writing my own placeholders. But I want to give you what I have learned and what would be useful in your library:
<div class="ph-col-12 h2"></div>
:
$ph-height: 18px;
$ph-height-small: 15px;
$ph-height-h1: 80px;
$ph-height-h2: 58px;
$ph-height-h3: 44px;
$ph-height-h4: 25px;
Further I needed to have classes for each breakpoint, same as Bootstrap has. This is what I ended up with:
@each $breakpoint in map-keys($grid-breakpoints) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
@include media-breakpoint-up($breakpoint, $grid-breakpoints) {
@if $grid-row-columns > 0 {
@for $i from 1 through $ph-grid-columns {
.ph-col#{$infix}-#{$i} {
background-color: $ph-color;
flex: 0 0 auto;
width: percentage($i / $ph-grid-columns);
height: $ph-height;
}
}
}
}
}
And then I can do:
<div class="ph-col-6 ph-col-md-2 small"></div>
Here is my final code
$ph-bg: white;
$ph-color: $gray-300;
$ph-image-height: 120px;
$ph-height: 18px;
$ph-height-small: 15px;
$ph-height-h1: 80px;
$ph-height-h2: 58px;
$ph-height-h3: 44px;
$ph-height-h4: 25px;
$ph-grid-columns: 12;
$ph-gutter-width: $grid-gutter-width/4;
$ph-animation-duration: .8s;
div[class^="ph-col"],
.ph-image,
.ph-round {
background-color: $ph-color;
}
.ph-row {
display: flex;
margin-bottom: $ph-gutter-width;
&.center {
justify-content: center;
}
&.right {
justify-content: flex-end;
}
}
.ph-image {
height: $ph-image-height;
width: 100%;
}
.ph-round {
border-radius: 50%;
width: $ph-image-height;
height: $ph-image-height;
}
div[class^="ph-col"] {
&.empty {
background-color: transparent;
}
&.small {
height: $ph-height-small;
}
&.h1 {
height: $ph-height-h1;
}
&.h2 {
height: $ph-height-h2;
}
&.h3 {
height: $ph-height-h3;
}
&.h4 {
height: $ph-height-h4;
}
}
@each $breakpoint in map-keys($grid-breakpoints) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
@include media-breakpoint-up($breakpoint, $grid-breakpoints) {
@if $grid-row-columns > 0 {
@for $i from 1 through $ph-grid-columns {
.ph-col#{$infix}-#{$i} {
background-color: $ph-color;
flex: 0 0 auto;
width: percentage($i / $ph-grid-columns);
height: $ph-height;
}
}
}
}
}
Wow! Thank you! I think you did a great job :) I'll keep you up2date with what we'll decide here.
Hi @MickL!
Please take a look, I think we are done.
Changes:
.clean
, but added a working example with a clean item in demo page / thank for your idea of using placeholder without any wrapper. I hope you find this a better idea instead of adding a new class :)Regarding on this type of animation... Sorry, is tightly coupled with background. So if we need to use a transparent background we have to remove it. In the near feature I plan to add a second animation, some simple loading circle :)
I think this is the best we can get with no breaking changes :) What do you think?
Again, thanks a lot for your time and precious contributions.
LE: please take a look at this PR #25. I think we should enable ltr support also for no wrapped version. Do you have any suggestion on where to move direction css prop?
Hi @MickL,
what do you think? Do you have any feedback or suggestions here :)
Hi guys. I updated the PR description accordingly with the latest commits :)
@zalog how are you feeling about the inclusion of the column generation code that @MickL integrated? That way everyone can just configure the amount of columns they'd like to have
Cols AND breakpoints are important imo
Sure, that's a great idea. Actually I love it :), but we try to keep PR's small and close them fast. So, @MickL you can open a new branch/PR, or I'll do that and mention you there. How that's sounds for you guys?
I agree to keep PRs small. I will not have the time but I posted my code above that you can copy from. @DKhalil I would open another issue for dynamic cols and breakpoints.
Tnks @MickL
Ok, we'll merge this, and I'll keep you guys posted in a future PR.
$ph-border
var::before
pointer-events: none
so it is not annoying when trying to debug with the inspectorLE:
Added .clean class to wrapper to have no background, border, margin and paddingreplaced by first line in the descriptionThe last .ph-row should not have margin-bottomreplaced by second lineAdded uneven cols to have more flexibilitywe'll add this in a new PRFixes #20