Skip to content

Commit

Permalink
Merge pull request #319 from nostalgic-css/fix-border-bugs-on-chrome
Browse files Browse the repository at this point in the history
fix: fix borders bugs on chrome without breaking in firefox
  • Loading branch information
BcRikko authored Mar 9, 2019
2 parents 028363a + 0aff122 commit b7b978b
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions scss/utilities/rounded-corners-mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,27 @@
border-image-source: url('data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" ?><svg version="1.1" width="5" height="5" xmlns="http://www.w3.org/2000/svg"><path d="M2 1 h1 v1 h-1 z M1 2 h1 v1 h-1 z M3 2 h1 v1 h-1 z M2 3 h1 v1 h-1 z" fill="rgb(#{red($color)},#{green($color)},#{blue($color)})" /></svg>');
}

@mixin border-image-repeat() {
border-image-repeat: stretch;

// for chrome
@media all and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: 0.001dpcm) {
border-image-repeat: space;
}

// for firefox
@supports (-moz-appearance: meterbar) {
border-image-repeat: stretch;
}
}

@mixin rounded-corners($isDark: false) {
@extend %rounded-corner-defaults;

border-image-slice: 3;
border-image-width: 3;
border-image-repeat: stretch;

@include border-image-repeat();

@if $isDark {
@include border-image($color-white);
Expand All @@ -34,7 +49,8 @@

border-image-slice: 2;
border-image-width: 2;
border-image-repeat: stretch;

@include border-image-repeat();

@if $isDark {
@include compact-border-image($color-white);
Expand Down

0 comments on commit b7b978b

Please sign in to comment.