From a877ef6e419fa95144e54dd4b30291487f7500f2 Mon Sep 17 00:00:00 2001 From: Mick Lawitzke Date: Sun, 24 Jan 2021 16:35:35 +0100 Subject: [PATCH] feat: adds wrapper var, `.clean`, some flexibility - 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 --- README.md | 7 +++++-- src/index.html | 20 ++++++++++++++++++-- src/scss/_layout.scss | 36 +++++++++++++++++++++++++++++++++++- src/scss/_variables.scss | 3 ++- 4 files changed, 60 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9162771..af321c1 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ $ph-border-radius: 2px !default; $ph-gutter: 30px !default; $ph-spacer: 15px !default; +$ph-item-border: 1px solid darken($ph-bg, 10%) !default; $ph-avatar-border-radius: 50% !default; @@ -76,7 +77,9 @@ A simple html markup would be something like this: ``` -- grid classes: `.ph-col-2`, `.ph-col-4`, `.ph-col-6`, `.ph-col-8`, `.ph-col-10`, `.ph-col-12` +Use `
` if you prefer to have no wrapper (background, border, margin) around. + +- grid classes: `.ph-col-1`, `.ph-col-2`, `.ph-col-3`, `.ph-col-4`, `.ph-col-5`, `.ph-col-6`, `.ph-col-7`, `.ph-col-8`, `.ph-col-9`, `.ph-col-10`, `.ph-col-11`, `.ph-col-12` - elements inside: `.ph-avatar` and `.ph-picture` @@ -95,7 +98,7 @@ A simple html markup would be something like this: ## Contributing -Please read angular's [CONTRIBUTING.md](https://github.com/angular/angular/blob/master/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us. +Please read Angular's [CONTRIBUTING.md](https://github.com/angular/angular/blob/master/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us. ## Versioning diff --git a/src/index.html b/src/index.html index b63cb3d..91f6635 100644 --- a/src/index.html +++ b/src/index.html @@ -46,7 +46,7 @@

Generic placeholder

-

Placeholder in a external twitter bootstrap grid

+

Placeholder in a external Bootstrap grid

@@ -103,6 +103,22 @@

Placeholder in a external twitter bootstrap grid

+

Just Placeholder without wrapper

+ +
+ +
+
+ +
+
+
+
+
+
+ +
+

Other placeholder examples

@@ -235,4 +251,4 @@

Other placeholder examples

- \ No newline at end of file + diff --git a/src/scss/_layout.scss b/src/scss/_layout.scss index ddd5c66..f0ed759 100644 --- a/src/scss/_layout.scss +++ b/src/scss/_layout.scss @@ -12,11 +12,12 @@ overflow: hidden; margin-bottom: $ph-gutter; background-color: $ph-bg; - border: 1px solid darken($ph-bg, 10%); + border: $ph-item-border; border-radius: $ph-border-radius; &::before { content: " "; + pointer-events: none; position: absolute; top: 0; right: 0; @@ -36,6 +37,17 @@ padding-right: ($ph-gutter / 2); padding-left: ($ph-gutter / 2); } + + &.clean { + padding: 0; + background: transparent; + border: 0 transparent; + margin: 0; + + > * { + padding: 0; + } + } } .ph-row { @@ -56,23 +68,45 @@ .empty { background-color: rgba($ph-bg, 0); } + + &:last-child { + margin-bottom: 0; + } } +.ph-col-1 { + flex: 0 0 percentage(1 / 12); +} .ph-col-2 { flex: 0 0 percentage(2 / 12); } +.ph-col-3 { + flex: 0 0 percentage(3 / 12); +} .ph-col-4 { flex: 0 0 percentage(4 / 12); } +.ph-col-5 { + flex: 0 0 percentage(5 / 12); +} .ph-col-6 { flex: 0 0 percentage(6 / 12); } +.ph-col-7 { + flex: 0 0 percentage(7 / 12); +} .ph-col-8 { flex: 0 0 percentage(8 / 12); } +.ph-col-9 { + flex: 0 0 percentage(9 / 12); +} .ph-col-10 { flex: 0 0 percentage(10 / 12); } +.ph-col-11 { + flex: 0 0 percentage(11 / 12); +} .ph-col-12 { flex: 0 0 percentage(12 / 12); } diff --git a/src/scss/_variables.scss b/src/scss/_variables.scss index 8b0d696..b17f51f 100644 --- a/src/scss/_variables.scss +++ b/src/scss/_variables.scss @@ -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; $ph-avatar-border-radius: 50% !default; -$ph-animation-duration: .8s !default; +$ph-animation-duration: .8s !default;