-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
feat: adds no wrap demo, refactors Y margins #22
Conversation
Hi @MickL, thanks again for your time! :) If it's ok with you, let's make some changes please:
Nice touch about |
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 |
src/scss/_layout.scss
Outdated
@@ -36,6 +37,17 @@ | |||
padding-right: ($ph-gutter / 2); | |||
padding-left: ($ph-gutter / 2); | |||
} | |||
|
|||
&.clean { |
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.
Do you think we should rename .clean
in something more specific? .clean
. Something like .ph-item-full
, .ph-item-border-0
, .ph-item-*
.
src/scss/_layout.scss
Outdated
@@ -56,23 +68,45 @@ | |||
.empty { | |||
background-color: rgba($ph-bg, 0); | |||
} | |||
|
|||
&:last-child { |
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.
Do you think we should use * + *
with margin-top to be less css specificity?
src/scss/_variables.scss
Outdated
@@ -4,7 +4,8 @@ $ph-border-radius: 2px !default; | |||
|
|||
$ph-gutter: 30px !default; | |||
$ph-spacer: 15px !default; | |||
$ph-item-border: 1px solid darken($ph-bg, 10%) !default; |
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.
I think we should rename it to $ph-border
and move it on line 4, to match the others. What do you think?
"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:
But this does not:
Or:
-> 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. 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. |
a877ef6
to
401d251
Compare
- adds variable to control wrapper border - adds uneven cols to have more flexibility - adds .clean class to wrapper to have no background, border, margin and padding - last .ph-row should not have margin-bottom - updates readme
401d251
to
61bc000
Compare
This will comes in another PR from configuration setting.
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:
$ph-height: 18px;
$ph-height-small: 15px;
$ph-height-h1: 80px;
$ph-height-h2: 58px;
$ph-height-h3: 44px;
$ph-height-h4: 25px;
@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 :) |
Renames var to match project naming.
Fixes bottom symmetry inside `.ph-item`.
- refactors how margins are applied - uses `.ph-col` as wrapper in demo, but all `.ph-col-*` are working for spacings
Hi @MickL! Please take a look, I think we are done. Changes:
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 :) 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 :) |
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. |
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