Développeur
Faire l'ensemble des drapeaux des pays du monde en CSS, avec un seul div
par drapeau.
width: 100px;
border-left: 100px solid blue;
border-right: 100px solid red;
background: white;
background-image:
linear-gradient(...),
linear-gradient(180deg,
transparent 0px, transparent 37px,
blue 37px, blue 74px,
transparent 74px, transparent 100%),
linear-gradient(...),
linear-gradient(...);
/* Bénin */
linear-gradient(90deg, [...], green),
linear-gradient(180deg, [...], yellow),
linear-gradient(180deg, [...], red),
/* Japon */
background-color: white;
backgroud-image: radial-gradient(
circle at 110px 74px,
red 44px,
transparent 45px
)
background: red;
&:before {
content: "★";
color: yellow;
position: absolute;
top: 30px;
left: 66px;
font-size: 88px;
line-height: 88px;
}
@font-face {
font-family: "Symbols";
src: url("../fonts/Symbols.svg");
[...]
}
&:before {
color: blue;
content: "★";
top: 48px;
left: 103px;
text-shadow: 36px 9px 0px blue,
36px -9px 0px blue,
-36px 9px 0px blue,
-36px -9px 0px blue
}
background-color: green;
background-image: radial-gradient(
circle at 110px 41px,
green 45px,
transparent 46x
),
radial-gradient(
circle at 110px 55px,
yellow 47px,
transparent 48px
)
&:before {
[...]
width: 110px;
height: 147px;
background-color: blue;
clip-path: polygon(0 0, 100% 50%, 0 100%);
}
# Shell
scss -r ./geometry_helper.rb input.scss
# Ruby
require 'sass'
module Sass::Script::Functions
module GeometryHelper
def deg_to_rad(value)
value * Math::PI / 180;
end
def cos(number)
Sass::Script::Number.new(Math.cos(deg_to_rad(number.value)))
end
end
include GeometryHelper
end
// SCSS
$red-stripe-size: cos($alpha) * $height;
L'important n'est pas la destination mais le voyage