Advertisement
terorama

COMPASS/SASS Examples

Sep 6th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.80 KB | None | 0 0
  1. //--------------------------------------------------------------
  2. //--------------------------------------------------------------
  3. /* Welcome to Compass.
  4. * In this file you should write your main styles. (or centralize your imports)
  5. * Import this file using the following HTML or equivalent:
  6. * <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" /> */
  7.  
  8. //---------------------------------------------------------------
  9. //@import "compass/reset";
  10.  
  11. //@import "bourbon";
  12.  
  13. @import "compass/support";
  14. @import "compass/css3";
  15. @import "compass/layout";
  16.  
  17.  
  18.  
  19.  
  20. //@import "foundation/components/labels";
  21.  
  22. @import "sassy-buttons";
  23.  
  24. @import "compass/reset/utilities";
  25. @import "compass/typography";
  26. @import "compass/utilities/tables";
  27.  
  28. //@import "foundation/variables";
  29. //@import "foundation/components/global";
  30.  
  31. @import "blueprint/buttons";
  32. @import "blueprint/fancy-type";
  33. @import "blueprint/form";
  34. @import "blueprint/interaction";
  35. //@import "blueprint/reset";
  36. @import "blueprint/typography";
  37. @import "blueprint/utilities";
  38.  
  39. //---------------------------------------------------------------
  40.  
  41. $outer_w : 200px;
  42. $inner_w : floor($outer_w/2);
  43. $gray-slug : gray !default;
  44.  
  45. //---------------------------------------------------------------
  46.  
  47. @mixin zbox($size, $color) {
  48.  
  49. position: absolute;
  50. width: $size;
  51. height: $size;
  52. top: floor($size/2);
  53. left: floor($size/2);
  54.  
  55. background-color: $color;
  56. }
  57. //------------------------------
  58. @mixin navigation-list {
  59.  
  60. list-style-type: none;
  61. margin: 0;
  62.  
  63. padding: 0;
  64. overflow: hidden;
  65.  
  66. >li {
  67. display: block;
  68. float: left;
  69. margin-right:5px;
  70. padding: 5px;
  71. border-left: solid 1px #999;
  72. &:last-child {
  73. margin-right: 0;
  74. }
  75. &:first-child {
  76. border: none;
  77. }
  78. }
  79. }
  80.  
  81. //------------------------------
  82. @mixin zbox4 {
  83. float: left;
  84. margin-right:5px;
  85. width: 200px;
  86. height: 200px;
  87. }
  88.  
  89. //------------------------------
  90. @mixin zborder4 {
  91.  
  92. $bord_color: #aaa;
  93. border-right: solid 1px $bord_color;
  94. border-bottom: solid 1px $bord_color;
  95. border-top: solid 1px $bord_color;
  96. border-left: solid 1px $bord_color;
  97.  
  98. }
  99.  
  100. //------------------------------
  101. @function g_shade($a, $opacity) {
  102. @return rgba($a,$a,$a,$opacity);
  103. }
  104.  
  105. //---------------------------------------------------------------
  106. @include font-face("MyFont", font-files("test.otf"));
  107.  
  108. //------------------------------
  109.  
  110. //@include global-reset;
  111. //@include blueprint-global-reset;
  112.  
  113. //@include blueprint-typography;
  114.  
  115.  
  116.  
  117.  
  118. .section {
  119. float:left;
  120. overflow:hidden;
  121. padding: 10px;
  122. margin-right: 5px;
  123. margin-bottom: 5px;
  124. @include zborder4;
  125. }
  126.  
  127.  
  128. h3 {
  129. @include sassy-button;
  130. }
  131. //------------------------------
  132. #blueprint-button {
  133.  
  134. @include button-button(false);
  135. @include button-colors(red,yellow,orange,pink);
  136. @include button-active-colors(yellow,red,pink,orange);
  137. @include button-hover-colors(white,orange,red,pink);
  138. }
  139.  
  140. //------------------------------
  141. #blueprint-fancy-type {
  142. @include fancy-type;
  143. }
  144. #blueprint-alt {
  145. @include alt;
  146. }
  147. #blueprint-dquo {
  148. @include dquo;
  149. }
  150. #blueprint-incr {
  151. @include incr;
  152. }
  153. #blueprint-caps {
  154. @include caps;
  155. }
  156. #blueprint-fancy-paragraphs {
  157. @include fancy-paragraphs;
  158. }
  159. #blueprint-sibling-indentation {
  160. @include sibling-indentation;
  161. }
  162.  
  163. //------------------------------
  164. #blueprint-inline-form {
  165. @include blueprint-inline-form;
  166. }
  167.  
  168. #blueprint-form {
  169. @include blueprint-form-layout;
  170. @include blueprint-form-borders;
  171. @include blueprint-form-sizes;
  172. }
  173.  
  174. //------------------------------
  175. #blueprint-interaction {
  176. .feedback {
  177. @include feedback-base;
  178. }
  179. .error {
  180. @include error;
  181. }
  182. .notice {
  183. @include notice;
  184. }
  185. .success {
  186. @include success;
  187. }
  188. .info {
  189. @include info;
  190. }
  191. .highlight {
  192. @include highlight;
  193. }
  194. .added {
  195. @include added;
  196. }
  197. .removed {
  198. @include removed;
  199. }
  200. }
  201. //------------------------------
  202. #blueprint-utilities {
  203. .nowrap {
  204. @include nowrap;
  205. }
  206. .clearfix {
  207. @include clearfix;
  208. }
  209. }
  210. //------------------------------
  211. .box-shadow {
  212. @include zbox(50px, #afa);
  213. top:50px;
  214. }
  215.  
  216. #box-shadows {
  217. position: relative;
  218. height:300px;
  219. }
  220.  
  221. #box-shadow-default {
  222. @extend .box-shadow;
  223. @include single-box-shadow;
  224. }
  225. #box-shadow-custom {
  226. @extend .box-shadow;
  227. left:100px;
  228. @include box-shadow(red 2px 2px 10px);
  229. }
  230. #box-shadow-custom-multiple {
  231. @extend .box-shadow;
  232. left:170px;
  233. @include box-shadow(rgba(blue,0.8) 4px 4px 25px, rgba(green,0.9) 0 0 30px inset);
  234. }
  235.  
  236. //------------------------------
  237. #compass-inline-block {
  238. @include inline-block;
  239. }
  240.  
  241. //------------------------------
  242. #compass-opacity-example {
  243. div {
  244. float: left;
  245. width: 40px;
  246. height: 40px;
  247. color: white;
  248. background: red;
  249. }
  250. }
  251.  
  252. @for $i from 1 to 5 {
  253. #compass-opacity-example div:nth-child(#{$i}) {
  254. @include opacity($i/10*2);
  255. }
  256. }
  257.  
  258. //------------------------------
  259. $default-text-shadow-color: rgba(red,0.6);
  260. $default-text-shadow-blur: 3px;
  261. $default-text-shadow-v-offset: 1px;
  262.  
  263. #compass-text-shadow {
  264. .single-shadow {
  265. @include single-text-shadow;
  266. }
  267. .custom-shadow {
  268. @include text-shadow(rgba(blue,0.2) 1px 1px 0, rgba(red,0.5) 2px 2px 0, rgba(yellow,0.9) 3px 3px 0);
  269. }
  270. }
  271.  
  272. //------------------------------
  273. #wrapper4 {
  274. position: relative;
  275. height: $outer_w+40px;
  276. }
  277. //------------------------------
  278. #test4 {
  279. @include zbox($outer_w, red);
  280. margin-top: -$outer_w/2;
  281. @include border-radius(floor($outer_w/4));
  282. div {
  283. @include zbox($inner_w, yellow);
  284. @include border-radius(floor($inner_w/4));
  285. @include rotate;
  286. }
  287. }
  288. //------------------------------
  289. #test5 {
  290. font-family: "MyFont";
  291. font-size: 2em;
  292. }
  293. //------------------------------
  294. #test_img {
  295. background-image: image-url("tanec1.jpg");
  296. width: image-width("tanec1.jpg");
  297. height: image-height("tanec1.jpg");
  298. }
  299. //------------------------------
  300. @for $i from 1 to 4 {
  301. .#{$gray-slug}-#{$i} {
  302.  
  303. $zsize : $outer_w - 40px*$i;
  304. @include zbox($zsize, g_shade($i*60, 1)) ;
  305.  
  306. @if $i==1 {
  307. position: relative;
  308. margin-top: -$outer_w/3*1.5!important;
  309. margin-bottom: $outer_w/2;
  310. }
  311.  
  312. margin-left: -$zsize/4;
  313. margin-top: -$zsize/4;
  314. }
  315. }
  316. //------------------------------
  317. #nav4 {
  318.  
  319. @include navigation-list;
  320. margin-top:100px;
  321. }
  322. //------------------------------
  323.  
  324. #gradients4 {
  325.  
  326. div {
  327. @include zbox4;
  328.  
  329. &:nth-child(1) {
  330. @include background-image(radial-gradient(30px 60px, aqua 10px, #ff0000 90px));
  331. }
  332. &:nth-child(2) {
  333. @include background-image(linear-gradient(left top, white, #f00));
  334. }
  335.  
  336. &:nth-child(3) {
  337. @include background-image(linear-gradient(orange,green));
  338. }
  339. &:nth-child(4) {
  340. @include background-image(linear-gradient(red,orange,yellow));
  341. }
  342. &:nth-child(5) {
  343. @include background-image(linear-gradient(white, red 30%, green 70%, black));
  344. }
  345.  
  346. &:nth-child(6) {
  347. @include background-image(linear-gradient(left, white, black));
  348. }
  349.  
  350. }
  351. }
  352.  
  353. //------------------------------
  354. #blueprint-typography4 {
  355.  
  356. clear: left;
  357.  
  358. .normal-text {
  359. @include normal-text;
  360. }
  361. .fixed-width-text {
  362. @include fixed-width-text;
  363. }
  364. .header-text {
  365. @include header-text;
  366. }
  367. .quiet {
  368. @include quiet;
  369. }
  370. .loud {
  371. @include loud;
  372. }
  373. }
  374.  
  375. //------------------------------
  376. #compass-grid-background {
  377. width:200px;
  378. height:200px;
  379. @include grid-background;
  380. }
  381.  
  382. //------------------------------
  383. #compass-stretch-layout div {
  384.  
  385. float: left;
  386. margin-right: 10px;
  387. width: 150px;
  388. height: 150px;
  389. position: relative;
  390.  
  391. >div {
  392. @include button-button;
  393.  
  394. background: darken(orange,10);
  395. color: white;
  396.  
  397. &.stretch-full {
  398. @include stretch;
  399. }
  400. &.stretch-offset {
  401. @include stretch(1em,1em,1em,1em);
  402. }
  403. &.stretch-x {
  404. @include stretch-x(4em,4em);
  405. }
  406. &.stretch-y {
  407. @include stretch-y(3em,3em);
  408. }
  409. }
  410. }
  411.  
  412. //------------------------------
  413. #compass-typography {
  414.  
  415. p {
  416. @include info;
  417. }
  418.  
  419. .hover-link {
  420. @include hover-link;
  421. }
  422. .link-colors {
  423. @include link-colors(red, green, orange, lighten(red,10), darken(red,10));
  424. }
  425. .unstyled-link {
  426. @include unstyled-link;
  427. }
  428.  
  429. .no-bullet {
  430. @include no-bullet;
  431. }
  432. .no-bullets {
  433. @include no-bullets;
  434. }
  435. .pretty-bullets {
  436. $z : "type_audio.png";
  437. $w : image_width($z);
  438. $h : image_height($z);
  439. @include pretty-bullets($z, $w, $h, 2, $w*2);
  440. }
  441. .horizontal-list {
  442. @include horizontal-list;
  443. }
  444. .inline-list {
  445. @include inline-list;
  446. }
  447. .delimetered-list {
  448. @include delimited-list(" |");
  449. li {
  450. padding-left: 5px;
  451. }
  452. }
  453. .inline-block-list {
  454. @include inline-block-list(15px);
  455. }
  456.  
  457. }
  458.  
  459. //------------------------------
  460. #compass-table {
  461. border-collapse: collapse;
  462.  
  463. $table-color: lighten(yellow,20%);
  464. @include table-scaffolding;
  465.  
  466. @include alternating-rows-and-columns($table-color, adjust-hue($table-color, 10deg), #333,
  467. lighten(red,30%), green);
  468.  
  469. @include inner-table-borders(1px, #444);
  470. @include outer-table-borders(2px, red);
  471.  
  472. }
  473.  
  474.  
  475. //------------------------------
  476. //------------------------------
  477.  
  478.  
  479. //--------------------------------------------------------------
  480. //--------------------------------------------------------------
  481.  
  482. @import "compass/utilities/general/hacks";
  483. @import "compass/utilities/general/float";
  484. @import "compass/utilities/general/min";
  485. @import "bourbon";
  486.  
  487. .section {
  488. @include has_layout;
  489. @include float-left;
  490.  
  491. border: solid 1px #777;
  492. padding: 5px;
  493. @include border-top-radius(10px);
  494. @include border-bottom-radius(30px);
  495.  
  496. @include min-width(400px);
  497. @include min-height(300px);
  498. }
  499.  
  500. h3 {
  501. @include button(shiny, #ff0000);
  502. margin: 0 auto;
  503. }
  504.  
  505. //-----------------------------------
  506. #bourbon-buttons {
  507. div:first-child {
  508. @include button;
  509. }
  510. div:nth-child(2) {
  511. @include button(pill, green);
  512. }
  513. div:last-child {
  514. @include button(shiny, orange);
  515. }
  516. }
  517.  
  518. //--------------------------------------------------------------
  519. //--------------------------------------------------------------
  520. @import 'susy';
  521.  
  522. #container1 {
  523.  
  524. border: solid 1px red;
  525.  
  526. $total-columns: 12;
  527. $column-width: 4em;
  528. $gutter-width: 1em;
  529. $grid-padding: $gutter-width;
  530.  
  531. @include container;
  532.  
  533. @include susy-grid-background;
  534.  
  535. .banner {
  536. clear: both;
  537. background: #ffeeee;
  538. @include push(3,12);
  539.  
  540. }
  541.  
  542. .pagenav {
  543. @include span-columns(3,12);
  544. @include bleed(2);
  545. background: rgba(red,0.3);
  546.  
  547.  
  548. }
  549.  
  550. .contentinfo {
  551. @include span-columns(9 omega);
  552.  
  553.  
  554. }
  555.  
  556. .main {
  557. @include span-columns(9 omega, 12);
  558. outline: solid 1px green;
  559.  
  560. .summary {
  561. //@include box-sizing(border-box);
  562. @include span-columns(4,9);
  563. @include pull(2,9);
  564.  
  565. margin-top:500px;
  566. background: rgba(#eeffee,0.4);
  567.  
  568. }
  569. .content {
  570. @include span-columns(5 omega, 9);
  571. @include prefix(1,9);
  572. @include suffix(1,9);
  573. background: rgba(orange,0.5);
  574.  
  575. .content4 {
  576. @include span-columns(3,5);
  577. @include post(1,5);
  578. background: rgba(red, 0.2);
  579.  
  580. }
  581.  
  582. .content5 {
  583. @include span-columns(3,5);
  584. @include pre(1,5);
  585. background: rgba(red, 0.2);
  586. }
  587. }
  588. }
  589.  
  590.  
  591.  
  592. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement