// United States of America // http://www.crwflags.com/fotw/flags/us.html @mixin flag-usa() { @include ratio(10 / 19); $unit: $width / 24700; $red: #ba0c2f; $blue: #012169; $white: #FFF; $stripe-size: percentage(1/13); $star-size: 800 * $unit; $star-margin-left: 1646 * $unit; $star-margin-top: 700 * $unit; $star-even-offset-left: 823 * $unit; $star-even-offset-top: 700 * $unit; $star-odd-offset-left: 1646 * $unit; $star-odd-offset-top: 1400 * $unit; $canton-width: 9876 * $unit; $canton-height: 7000 * $unit; @include lines($red, $stripe-size, $white, $stripe-size, $red, $stripe-size, $white, $stripe-size, $red, $stripe-size, $white, $stripe-size, $red, $stripe-size, $white, $stripe-size, $red, $stripe-size, $white, $stripe-size, $red, $stripe-size, $white, $stripe-size, $red, $stripe-size); &:before { @include rectangle($blue, $canton-width, $canton-height); } &:after { @include symbol($UTF8_BLACK_STAR, transparent, $star-size); $shadows: (); @for $y from 0 to 9 { @for $x from 0 to 6 { $is_odd: ($y % 2 == 1); $is_last: ($x == 5); $offset-left: $star-even-offset-left; $offset-top: $star-even-offset-top; // Slightly move even rows on the right @if ($is_odd) { $offset-left: $star-odd-offset-left; } // Do not display the 6th star of odd lines @if (not ($is_odd and $is_last)) { $left: ($offset-left + ($x * $star-margin-left)); $top: ($offset-top + ($y * $star-margin-top)); $shadows: append($shadows, $left $top 0px $white, comma); } } } text-shadow: $shadows; } };