SASS & LESS copies

This commit is contained in:
ErikBoesen
2016-09-12 10:23:40 -04:00
parent ffb26ae604
commit e772eb1d5b
3 changed files with 153 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
# banners.css
![Screenshot](screenshot.png)
banners.css is a simple CSS preset to allow easy creation of simulated [FRC](http://firstinspires.org/robotics/frc) blue banners (typically awarded to teams upon receiving a competition award.)
banners.css is a simple CSS preset to allow easy creation of simulated [FRC](http://firstinspires.org/robotics/frc) blue banners (typically presented to teams upon receiving a competition award.)
This framework allows for three different types of banners:
@@ -17,8 +17,10 @@ Repeat the above process, except instead of defining a `<ul>` with `<li>`s as ch
Repeat the first process exactly, however with one extra step: enclose the `<ul>` with a `<div>` with the class `banner-parent`. This will cause the row of banners to expand to fill the whole width of the screen, and any extra banners will be visible by scrolling to the side.
## Examples
* [Team 1418's website](http://1418.team)
* See `example.html`
* [Team 1418's website](http://1418.team)
* [Team 1257's awards page](http://team1257.org/#awards)
* [Team 3492's about page](http://parts3492.org/about/)
If you use this framework on your own project, feel free to open a pull request to add it to this list!

89
banners.less Normal file
View File

@@ -0,0 +1,89 @@
@blue: #0f4bcb;
@font-face {
font-family: 'Adam';
src: url('adam.otf') format('opentype');
unicode-range: U+0000-00FF;
}
.banners {
box-sizing: border-box;
margin: 0;
padding: 0;
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
li {
background: @blue;
color: white;
display: inline-block;
font-family: 'Adam', sans-serif;
line-height: 1.2;
margin: 0 3px 30px;
padding: 10px;
position: relative;
text-align: center;
vertical-align: top;
white-space: normal;
width: 120px;
&:after {
border-bottom: 20px transparent solid;
border-top-width: 5px;
border: 60px solid @color0;
content: '';
display: block;
left: 0;
position: absolute;
top: 100%;
}
}
img {
margin-bottom: 5px;
width: 75px;
}
}
.banner {
background: @color0;
box-sizing: border-box;
color: white;
display: inline-block;
font-family: 'Adam', sans-serif;
line-height: 1.2;
margin: 0;
margin: 0 3px 30px;
padding: 0;
padding: 10px;
position: relative;
text-align: center;
vertical-align: top;
white-space: normal;
width: 120px;
img {
margin-bottom: 5px;
width: 75px;
}
&:after {
border-bottom: 20px transparent solid;
border-top-width: 5px;
border: 60px solid @blue;
content: '';
display: block;
left: 0;
position: absolute;
top: 100%;
}
}
.banner-parent {
overflow: scroll;
width: 100%;
.banners {
white-space: nowrap;
width: auto;
}
}
.banners li, .banners li:after, .banner, .banner:after {
-webkit-filter: drop-shadow(0 10px 5px rgba(0, 0, 0, .1));
filter: drop-shadow(0 10px 5px rgba(0, 0, 0, .1));
}

60
banners.sass Normal file
View File

@@ -0,0 +1,60 @@
@charset 'utf-8'
$blue: #0f4bcb
@font-face
font-family: 'Adam'
src: url('adam.otf') format("opentype")
unicode-range: U+0000-00FF
// To be standard-compliant, this rule should be applied to *, but for compat it's restricted here.
.banners, .banners *, .banner
margin: 0
padding: 0
box-sizing: border-box
.banner-parent
width: 100%
overflow: scroll
.banners
width: auto
white-space: nowrap
.banners li, .banner
line-height: 1.2
font-family: 'Adam', sans-serif
text-align: center
vertical-align: top
display: inline-block
margin: 0 3px 30px
width: 120px
position: relative
background: $blue
color: white
padding: 10px
white-space: normal
.banners img, .banner img
width: 75px
margin-bottom: 5px
.banners li:after, .banner:after
content: ''
position: absolute
display: block
border: 60px solid $blue
border-top-width: 5px
border-bottom: 20px transparent solid
top: 100%
left: 0
.banners li, .banner
-webkit-filter: drop-shadow(0 10px 5px rgba(0, 0, 0, 0.1))
filter: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="filter"><feGaussianBlur in="SourceAlpha" stdDeviation="5" /><feOffset dx="1" dy="11" result="offsetblur" /><feFlood flood-color="rgba(0,0,0,0.1)" /><feComposite in2="offsetblur" operator="in" /><feMerge><feMergeNode /><feMergeNode in="SourceGraphic" /></feMerge></filter></svg>#filter')
-webkit-filter: drop-shadow(0 10px 5px rgba(0, 0, 0, 0.1))
filter: drop-shadow(0 10px 5px rgba(0, 0, 0, 0.1))
&:after
-webkit-filter: drop-shadow(0 10px 5px rgba(0, 0, 0, 0.1))
filter: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="filter"><feGaussianBlur in="SourceAlpha" stdDeviation="5" /><feOffset dx="1" dy="11" result="offsetblur" /><feFlood flood-color="rgba(0,0,0,0.1)" /><feComposite in2="offsetblur" operator="in" /><feMerge><feMergeNode /><feMergeNode in="SourceGraphic" /></feMerge></filter></svg>#filter')
-webkit-filter: drop-shadow(0 10px 5px rgba(0, 0, 0, 0.1))
filter: drop-shadow(0 10px 5px rgba(0, 0, 0, 0.1))