Skip to content

Commit 1893125

Browse files
committed
Bugfix
1 parent e8eb443 commit 1893125

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@omnedia/ngx-gridpattern",
33
"description": "A simple component library to create a container with a pattern background.",
4-
"version": "1.1.0",
4+
"version": "1.1.1",
55
"peerDependencies": {
66
"@angular/common": "^18.2.0",
77
"@angular/core": "^18.2.0"

src/lib/ngx-gridpattern.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ export class NgxGridpatternComponent {
3737
gridStyle: any = {};
3838

3939
setGridStyle(): void {
40-
const dataUri = `data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='none' stroke='${this.gridColor}' %3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e`;
40+
let dataUri = '';
41+
42+
if (this.smallGrid) {
43+
dataUri = `data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='16' height='16' fill='none' stroke='${this.gridColor}' %3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e`;
44+
} else {
45+
dataUri = `data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='none' stroke='${this.gridColor}' %3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e`;
46+
}
4147
this.gridStyle["background-image"] = `url("${dataUri}")`;
4248
this.gridStyle["--om-gridpattern-gradient-color"] = this.gradientColor;
4349
}

0 commit comments

Comments
 (0)