akoimeexx

CSS Isometric Layers

Jun 28th, 2011
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 5.56 KB | None | 0 0
  1. /**
  2.  * CSS Isometric Layer Display
  3.  *  written by Akoi Meexx - June 14th, 2011
  4.  *
  5.  * Source obvs. free for all. If you use this and like it, just hit me up on
  6.  * twitter @akoimeexx. Everyone can always use a little ego boost.
  7.  */
  8.  
  9. /**
  10.  * CHANGELOG
  11.  *
  12.  *  August 4th, 2011
  13.  *      Added fallback colors for browsers w/o rgba() support.
  14.  *      Sorted transform rules to apply non-prefixed last.
  15.  *      Removed overflow: hidden from the body class.
  16.  *      Renamed the class to iso-metrics for the lulz.
  17.  *      Added this changelog.
  18.  *     
  19.  *  June 14th, 2011
  20.  *      Initial project creation.
  21.  */
  22.  
  23. /**
  24.  * Apply our iso-metrics class to the body element to show a rough layout of our
  25.  * DOM layers in isometric view. Float the body left to constrain the body
  26.  * contents. Then rock it like it's hawt, rock it like it's hawt...
  27.  */
  28. body.iso-metrics {
  29.     float: left !important;
  30.    
  31.         -moz-transform-origin: top right !important;
  32.         -ms-transform-origin: top right !important;
  33.         -o-transform-origin: top right !important;
  34.         -webkit-transform-origin: top right !important;
  35.     transform-origin: top right !important;
  36.         -moz-transform: rotate(-45deg) skew(15deg, 15deg) !important;
  37.         -ms-transform: rotate(-45deg) skew(15deg, 15deg) !important;
  38.         -o-transform: rotate(-45deg) skew(15deg, 15deg) !important;
  39.         -webkit-transform: rotate(-45deg) skew(15deg, 15deg) !important;
  40.     transform: rotate(-45deg) skew(15deg, 15deg) !important;
  41. }
  42.  
  43. /**
  44.  * Set up us the borders, margins, padding, and take off every text to stay
  45.  * inside their containers for great justice.
  46.  */
  47. .iso-metrics address, .iso-metrics article, .iso-metrics aside, .iso-metrics blockquote,
  48. .iso-metrics canvas, .iso-metrics dl, .iso-metrics div, .iso-metrics embed,
  49. .iso-metrics fieldset, .iso-metrics figure, .iso-metrics footer, .iso-metrics form,
  50. .iso-metrics header, .iso-metrics map, .iso-metrics object, .iso-metrics ol,
  51. .iso-metrics output, .iso-metrics p, .iso-metrics pre, .iso-metrics section,
  52. .iso-metrics table, .iso-metrics ul, .iso-metrics video {
  53.     border-bottom: 12px solid #c0c0c0 !important;
  54.     border-left: 12px solid #d0d0d0 !important;
  55.     border-right: 1px solid #a0a0a0 !important;
  56.     border-top: 1px solid #b0b0b0 !important;
  57.     border-bottom: 12px solid rgba(0, 0, 0, 0.10) !important;
  58.     border-left: 12px solid rgba(0, 0, 0, 0.05) !important;
  59.     border-right: 1px solid rgba(0, 0, 0, 0.20) !important;
  60.     border-top: 1px solid rgba(0, 0, 0, 0.15) !important;
  61.    
  62.     margin-bottom: 8px !important;
  63.     margin-left: 8px !important;
  64.     margin-right: 2px !important;
  65.     margin-top: 2px !important;
  66.    
  67.     padding: 2px !important;
  68.    
  69.     word-wrap: break-word !important;
  70. }
  71.     /**
  72.      * Give our block-level elements basic rgb(a) coloring (red, green, blue)
  73.      */
  74.     /* Red */
  75.     .iso-metrics address:nth-child(3n+1), .iso-metrics article:nth-child(3n+1),
  76.     .iso-metrics aside:nth-child(3n+1), .iso-metrics blockquote:nth-child(3n+1),
  77.     .iso-metrics canvas:nth-child(3n+1), .iso-metrics dl:nth-child(3n+1),
  78.     .iso-metrics div:nth-child(3n+1), .iso-metrics embed:nth-child(3n+1),
  79.     .iso-metrics fieldset:nth-child(3n+1), .iso-metrics figure:nth-child(3n+1),
  80.     .iso-metrics footer:nth-child(3n+1), .iso-metrics form:nth-child(3n+1),
  81.     .iso-metrics header:nth-child(3n+1), .iso-metrics map:nth-child(3n+1),
  82.     .iso-metrics object:nth-child(3n+1), .iso-metrics ol:nth-child(3n+1),
  83.     .iso-metrics output:nth-child(3n+1), .iso-metrics p:nth-child(3n+1),
  84.     .iso-metrics pre:nth-child(3n+1), .iso-metrics section:nth-child(3n+1),
  85.     .iso-metrics table:nth-child(3n+1), .iso-metrics ul:nth-child(3n+1),
  86.     .iso-metrics video:nth-child(3n+1) {
  87.         background-color: #ffd0d0 !important;
  88.         background-color: rgba(255, 0, 0, 0.05) !important;
  89.     }
  90.     /* Green */
  91.     .iso-metrics address:nth-child(3n+2), .iso-metrics article:nth-child(3n+2),
  92.     .iso-metrics aside:nth-child(3n+2), .iso-metrics blockquote:nth-child(3n+2),
  93.     .iso-metrics canvas:nth-child(3n+2), .iso-metrics dl:nth-child(3n+2),
  94.     .iso-metrics div:nth-child(3n+2), .iso-metrics embed:nth-child(3n+2),
  95.     .iso-metrics fieldset:nth-child(3n+2), .iso-metrics figure:nth-child(3n+2),
  96.     .iso-metrics footer:nth-child(3n+2), .iso-metrics form:nth-child(3n+2),
  97.     .iso-metrics header:nth-child(3n+2), .iso-metrics map:nth-child(3n+2),
  98.     .iso-metrics object:nth-child(3n+2), .iso-metrics ol:nth-child(3n+2),
  99.     .iso-metrics output:nth-child(3n+2), .iso-metrics p:nth-child(3n+2),
  100.     .iso-metrics pre:nth-child(3n+2), .iso-metrics section:nth-child(3n+2),
  101.     .iso-metrics table:nth-child(3n+2), .iso-metrics ul:nth-child(3n+2),
  102.     .iso-metrics video:nth-child(3n+2) {
  103.         background-color: #d0ffd0 !important;
  104.         background-color: rgba(0, 255, 0, 0.05) !important;
  105.     }
  106.     /* Blue */
  107.     .iso-metrics address:nth-child(3n+3), .iso-metrics article:nth-child(3n+3),
  108.     .iso-metrics aside:nth-child(3n+3), .iso-metrics blockquote:nth-child(3n+3),
  109.     .iso-metrics canvas:nth-child(3n+3), .iso-metrics dl:nth-child(3n+3),
  110.     .iso-metrics div:nth-child(3n+3), .iso-metrics embed:nth-child(3n+3),
  111.     .iso-metrics fieldset:nth-child(3n+3), .iso-metrics figure:nth-child(3n+3),
  112.     .iso-metrics footer:nth-child(3n+3), .iso-metrics form:nth-child(3n+3),
  113.     .iso-metrics header:nth-child(3n+3), .iso-metrics map:nth-child(3n+3),
  114.     .iso-metrics object:nth-child(3n+3), .iso-metrics ol:nth-child(3n+3),
  115.     .iso-metrics output:nth-child(3n+3), .iso-metrics p:nth-child(3n+3),
  116.     .iso-metrics pre:nth-child(3n+3), .iso-metrics section:nth-child(3n+3),
  117.     .iso-metrics table:nth-child(3n+3), .iso-metrics ul:nth-child(3n+3),
  118.     .iso-metrics video:nth-child(3n+3) {
  119.         background-color: #d0d0ff !important;
  120.         background-color: rgba(0, 0, 255, 0.05) !important;
  121.     }
Advertisement
Add Comment
Please, Sign In to add comment