Style tiles with SCSS

Developer
Size
13,579 Kb
Views
14,168

How do I make an style tiles with scss?

Design style tiles in the browser with SCSS! Fork this in CodePen and make your own tiles. Share your tiles with clients with the Full Page link. Go CodePen Pro and update styles on the fly in Live View in a meeting with your client. It's responsive, too. Get your in-browser design on.. What is a style tiles with scss? How do you make a style tiles with scss? This script and codes were developed by Xavier Porter on 27 October 2022, Thursday.

Style tiles with SCSS Previews

Style tiles with SCSS - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Style tiles with SCSS</title> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel='stylesheet prefetch' href='https://fortawesome.github.io/Font-Awesome/assets/font-awesome/css/font-awesome.css'> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ /* Design style tiles in the browser with SCSS! Fork this in CodePen and make your own tiles. Share your tiles with clients with the Full Page link. Go CodePen Pro and update styles on the fly in Live View in a meeting with your client. It's responsive, too. Get your in-browser design on. (Documentation in the JS tab.) */
/* Web Fonts @import */
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,800italic,100,400,800);
@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
/* BASIC STYLING
-------------------------------- */
/* Colours */
/* Basic typography */
/* font color in <header> */
/* Basic button styling */
/* Basic texture swatch styling */
/* end basic styling */
/* ADVANCED STYLING
-------------------------------- */
/* Main */
/* Header */
/* Colour swatches */
/* Texture swatches */
/* Buttons */
/* Typography samples */
/* Adjectives */
/* Footer */
/* end advanced styling */
/* SETTINGS
-------------------------------- */
/* Typography samples settings */
/* Grid settings */
/* Swatch grid settings (for the boxes containing Possible Colors and Textures */
/* end settings */
/* ================================================== */
/* Clearfix
-------------------- */
.group:after { visibility: hidden; display: block; content: ""; clear: both; height: 0;
}
* html .group { zoom: 1;
}
/* IE6 */
*:first-child + html .group { zoom: 1;
}
/* IE7 */
/* General styling
-------------------- */
*, *:after, *:before { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
}
html { font-size: 62.5%;
}
body { background: #dfdddc; font: 14px "Open Sans", serif; line-height: 1.5;
}
header, .main, footer { max-width: 81em; margin: 0 auto;
}
/* Header
-------------------- */
.header-wrapper { background: #222;
}
header { padding: 20px; background: #222;
}
header h1, header hgroup { position: relative; float: left;
}
header h1 { font: bold 3em/1 "Open Sans", sans-serif; color: white; text-transform: uppercase; letter-spacing: -2px; padding-right: .75em;
}
header h2 { font: bold 1.6em "Open Sans", sans-serif; color: rgba(255, 255, 255, 0.95);
}
header h3 { font: italic 1.2em "Open Sans", sans-serif; color: rgba(255, 255, 255, 0.95);
}
header h4 { font: 0.8em "Open Sans", serif; color: rgba(255, 255, 255, 0.95);
}
.project-title { position: relative; float: left;
}
.stroke { height: 5px; background: #590000; /* Old browsers */ background-image: -webkit-gradient(linear, 0% 50%, 100% 50%, color-stop(0%, #590000), color-stop(100%, #830000)); background-image: -webkit-linear-gradient(left, #590000, #830000); background-image: -moz-linear-gradient(left, #590000, #830000); background-image: -o-linear-gradient(left, #590000, #830000); background-image: linear-gradient(to right, #590000, #830000);
}
/* Main
-------------------- */
.main { padding: 20px; background: #dfdddc;
}
.section-heading { /* e.g., h3's like "Possible colors", "Textures" */ font: italic 1.3em "Open Sans", sans-serif; color: #777; margin-bottom: .5em;
}
.main p { margin-bottom: .5em;
}
section { margin-bottom: 2em;
}
/* Swatches
-------------------- */
[class*="swatch-"] { height: 5em; border: 4px solid white; box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.25); border-radius: 60px;
}
.color-swatch-1 { background: #222;
}
.color-swatch-2 { background: #500000;
}
.color-swatch-3 { background: #fff;
}
.color-swatch-4 { background: #dfdddc;
}
.color-swatch-5 { background: #a2a2a2;
}
.accent-color-1 { background: #104554;
}
.accent-color-2 { background: #833333;
}
.accent-color-3 { background: #FFD31E;
}
/* Texture swatches
-------------------- */
[class*="texture-swatch-"] { overflow: hidden; height: 8em; border: 4px solid white; box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.25); border-radius: 0;
}
.texture-swatch-1 { background: url("http://subtlepatterns.subtlepatterns.netdna-cdn.com/patterns/pw_maze_white.png") top left repeat;
}
.texture-swatch-2 { background: url("https://subtlepatterns.com/patterns/white_paperboard.png") top left repeat;
}
.texture-swatch-3 { background: url("http://subtlepatterns.subtlepatterns.netdna-cdn.com/patterns/subtle_grunge.png") top left repeat;
}
/* Buttons
--------------------- */
[class*="button-"] { display: inline-block; position: relative; margin-right: 1em; margin-bottom: 1em;
}
.button-1 { padding: 1em 1em 1em 3em; border-radius: 4px; background: #104554; text-align: center; text-decoration: none; font: 1.25em/1 "Open Sans", sans-serif; letter-spacing: 1px; color: white; transition: all .3s ease; position: relative; margin-top: 10px; font-weight: 400; -moz-box-shadow: #0c343f 2px 3px 2px; -webkit-box-shadow: #0c343f 2px 3px 2px; box-shadow: #0c343f 2px 3px 2px;
}
.button-1:hover { background: #145769; -moz-box-shadow: #0f4250 2px 3px 2px; -webkit-box-shadow: #0f4250 2px 3px 2px; box-shadow: #0f4250 2px 3px 2px;
}
.button-1:after { font-family: FontAwesome; position: absolute; display: inline-block; content: "\f00c"; top: 0; left: -4px; width: 40px; height: 100%; font-weight: normal; line-height: 26px; border-radius: 4px 0 0 4px; background: #0c333f; text-align: center; padding-top: 13px; font-size: 18px; color: #1c7a94; transition: all .2s ease;
}
.button-1:hover:after { background: #104554;
}
.button-2 { padding: 1em 3em 1em 1em; border-radius: 4px; background: #a2a2a2; text-align: left; text-decoration: none; font: 1.25em/1 "Open Sans", sans-serif; letter-spacing: 1px; color: white; transition: all .2s ease; position: relative; -moz-box-shadow: #7a7a7a 2px 3px 2px; -webkit-box-shadow: #7a7a7a 2px 3px 2px; box-shadow: #7a7a7a 2px 3px 2px;
}
.button-2:hover { background: #7b7b7b; -moz-box-shadow: dimgray 2px 3px 2px; -webkit-box-shadow: dimgray 2px 3px 2px; box-shadow: dimgray 2px 3px 2px;
}
.button-2:after { font-family: FontAwesome; position: absolute; display: inline-block; content: "\f054"; top: 0; right: -4px; width: 40px; height: 100%; font-weight: normal; line-height: 26px; border-radius: 0 4px 4px 0; background: #959595; text-align: center; padding-top: 13px; font-size: 18px; color: #c8c8c8; transition: all .2s ease;
}
.button-2:hover:after { background: #626262;
}
/* Typography samples
--------------------- */
.typography-samples { background: #fff; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; padding: 20px !important;
}
@media (min-width: 50em) { .typography-samples { padding: 20px; }
}
h3.typography-sample { font: 2.4em/1.25 "Open Sans", sans-serif; margin-bottom: .25em; color: #4d4d4d;
}
h4.typography-sample { font: 1.5em/1.25 "Open Sans", serif; margin-bottom: .25em; color: #104554; font-weight: 100;
}
p.typography-sample { font: 1em/1.5 "Open Sans", serif; color: #4d4d4d;
}
p.typography-sample strong { font-weight: 600;
}
p.typography-sample em { font-style: italic;
}
a.typography-sample { font: 1em "Open Sans", sans-serif; color: #9d0000; text-decoration: none; border-bottom: 1px solid #9d0000;
}
a.typography-sample:hover { color: #6a0000; transition: all .3s ease;
}
p[class*="font-details-"] { margin-top: .5em; margin-bottom: 2em; font: 0.75em/1 "Open Sans", serif; color: #9a9a9a;
}
p[class*="font-details-"] .font-color { font-style: italic;
}
/* Adjectives
-------------------- */
.adjective-1 { font: italic 1.6em/1 "Open Sans", sans-serif; color: #222;
}
.adjective-2 { font: bold 1.25em/1.25 "Open Sans", serif; color: #104554;
}
.adjective-3 { font: 1.5em/1 "Open Sans", sans-serif; color: #dfdddc;
}
.adjective-4 { font: 1.6em/1.15 "Open Sans", sans-serif; color: #500000;
}
.adjective-5 { font: bold italic 3em/0.7 "Open Sans", sans-serif; color: #a2a2a2;
}
.adjective-6 { font: bold italic 1.8em/1.1 "Open Sans", serif; color: #fff;
}
/* Footer
-------------------- */
.footer-wrapper { background: #d3d0cf;
}
footer { padding: 20px; font: italic 1em/1.5 "Open Sans", sans-serif; color: #4d4d4d;
}
footer a { font-weight: bold; color: #fff; text-decoration: none;
}
/* Grids
based on Chris Coyier's Dont Overthink It Grids
https://css-tricks.com/dont-overthink-it-grids/
-------------------- */
[class*='col-'] { float: left;
}
.grid:after { content: ""; display: table; clear: both;
}
.col-1-2 { width: 100%; /* Single-column by default, i.e., on mobile */
}
@media (min-width: 50em) { .col-1-2 { /* 2-column if viewport is wide enough*/ width: 47%; margin-right: 4%; }
}
.col-1-2:last-child { margin-right: 0;
}
.col-1-3 { width: 100%;
}
@media (min-width: 50em) { .col-1-3 { width: 33.3333%; }
}
[class*="col-"] { padding: 0;
}
@media (min-width: 50em) { [class*="col-"] { padding-left: 30px; }
}
[class*="col-"]:first-child { padding-left: 0;
}
/* Swatch grids [Want to add more swatch grid column options? Formula for calculating swatch width: width: (100% - ($swatch-margin * (y - 1))) / y; where y = number of swatches in a grid row]
*/
[class*='swatch-'] { float: left;
}
.swatchgrid:after { content: ""; display: table; clear: both;
}
.swatch-1-2 { width: 49%;
}
.swatch-1-3 { width: 32%;
}
.swatch-1-4 { width: 23.5%;
}
.swatch-1-5 { width: 18.4%;
}
[class*="swatch-"] { margin-left: 2%;
}
[class*="swatch-"]:first-child { margin-left: 0;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="header-wrapper"> <header class="group"> <h1>TAMU IT<br>Style Tile<br></h1> <hgroup class="project-title"> <h2>Services/CAS Refresh</h2> <h3>Style tile - Version 1</h3> <h4> Comfortably Aggie</h4> </hgroup> </header> <div class="stroke"></div>
</div>
<div class="main grid"> <div class="graphic-samples col-1-2"> <section class="swatches group"> <h3 class="section-heading">Color swatches</h3> <ul class="swatchgrid group"> <li class="color-swatch-1 swatch-1-5"></li> <li class="color-swatch-2 swatch-1-5"></li> <li class="color-swatch-3 swatch-1-5"></li> <li class="color-swatch-4 swatch-1-5"></li> <li class="color-swatch-5 swatch-1-5"></li> </ul> <h3 class="section-heading">Accent Color swatches</h3> <ul class="swatchgrid group"> <li class="accent-color-1 swatch-1-5"></li> <li class="accent-color-2 swatch-1-5"></li> <li class="accent-color-3 swatch-1-5"></li> </ul> </section> <section class="textures"> <h3 class="section-heading">Textures</h3> <ul class="swatchgrid group"> <li class="texture-swatch-1 swatch-1-3"></li> <li class="texture-swatch-2 swatch-1-3"></li> <li class="texture-swatch-3 swatch-1-3"></li> </ul> </section> <section class="buttons"> <h3 class="section-heading">Buttons</h3> <div> <a href="#" class="button-1">OK</a> <a href="#" class="button-2">Next</a> </div> </section> </div> <div class="typography-samples col-1-2"> <section class="typography-main"> <h3 class="typography-sample">A sample header</h3> <p class="font-details-h3"> <span class="font-name">Font Name</span>, <span class="font-color">#color value</span> </p> <h4 class="typography-sample">An example of a sub header</h4> <p class="font-details-h4"> <span class="font-name">Font Name</span>, <span class="font-color">#color value</span> </p> <p class="typography-sample"> This sample paragraph has <strong>strong parts</strong> and <em>emphasized parts</em>. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. </p> <p class="font-details-p"> <span class="font-name">Font Name</span>, <span class="font-color">#color value</span> </p> <a href="#" class="typography-sample">This is an example of a text link.</a> <p class="font-details-a"> <span class="font-name">Font Name</span>, <span class="font-color">#color value</span> </p> </section> <section class="adjectives grid"> <h3 class="section-heading">Adjectives</h3> <div class="grid group"> <p class="adjective-1 col-1-3">Comfortable</p> <p class="adjective-2 col-1-3">Intuitive</p> <p class="adjective-3 col-1-3">Cool</p> </div> <div class="grid group"> <p class="adjective-4 col-1-2">Easy to follow</p> <p class="adjective-5 col-1-2">Iconic</p> </div> </section> </div>
</div>
<div class="footer-wrapper"> <footer class="group"> <small> Style tile by Texas A&M IT.<br> </small> </footer>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Style tiles with SCSS - Script Codes CSS Codes

/* Design style tiles in the browser with SCSS! Fork this in CodePen and make your own tiles. Share your tiles with clients with the Full Page link. Go CodePen Pro and update styles on the fly in Live View in a meeting with your client. It's responsive, too. Get your in-browser design on. (Documentation in the JS tab.) */
/* Web Fonts @import */
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,800italic,100,400,800);
@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
/* BASIC STYLING
-------------------------------- */
/* Colours */
/* Basic typography */
/* font color in 
*/ /* Basic button styling */ /* Basic texture swatch styling */ /* end basic styling */ /* ADVANCED STYLING -------------------------------- */ /* Main */ /* Header */ /* Colour swatches */ /* Texture swatches */ /* Buttons */ /* Typography samples */ /* Adjectives */ /* Footer */ /* end advanced styling */ /* SETTINGS -------------------------------- */ /* Typography samples settings */ /* Grid settings */ /* Swatch grid settings (for the boxes containing Possible Colors and Textures */ /* end settings */ /* ================================================== */ /* Clearfix -------------------- */ .group:after { visibility: hidden; display: block; content: ""; clear: both; height: 0; } * html .group { zoom: 1; } /* IE6 */ *:first-child + html .group { zoom: 1; } /* IE7 */ /* General styling -------------------- */ *, *:after, *:before { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } html { font-size: 62.5%; } body { background: #dfdddc; font: 14px "Open Sans", serif; line-height: 1.5; } header, .main, footer { max-width: 81em; margin: 0 auto; } /* Header -------------------- */ .header-wrapper { background: #222; } header { padding: 20px; background: #222; } header h1, header hgroup { position: relative; float: left; } header h1 { font: bold 3em/1 "Open Sans", sans-serif; color: white; text-transform: uppercase; letter-spacing: -2px; padding-right: .75em; } header h2 { font: bold 1.6em "Open Sans", sans-serif; color: rgba(255, 255, 255, 0.95); } header h3 { font: italic 1.2em "Open Sans", sans-serif; color: rgba(255, 255, 255, 0.95); } header h4 { font: 0.8em "Open Sans", serif; color: rgba(255, 255, 255, 0.95); } .project-title { position: relative; float: left; } .stroke { height: 5px; background: #590000; /* Old browsers */ background-image: -webkit-gradient(linear, 0% 50%, 100% 50%, color-stop(0%, #590000), color-stop(100%, #830000)); background-image: -webkit-linear-gradient(left, #590000, #830000); background-image: -moz-linear-gradient(left, #590000, #830000); background-image: -o-linear-gradient(left, #590000, #830000); background-image: linear-gradient(to right, #590000, #830000); } /* Main -------------------- */ .main { padding: 20px; background: #dfdddc; } .section-heading { /* e.g., h3's like "Possible colors", "Textures" */ font: italic 1.3em "Open Sans", sans-serif; color: #777; margin-bottom: .5em; } .main p { margin-bottom: .5em; } section { margin-bottom: 2em; } /* Swatches -------------------- */ [class*="swatch-"] { height: 5em; border: 4px solid white; box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.25); border-radius: 60px; } .color-swatch-1 { background: #222; } .color-swatch-2 { background: #500000; } .color-swatch-3 { background: #fff; } .color-swatch-4 { background: #dfdddc; } .color-swatch-5 { background: #a2a2a2; } .accent-color-1 { background: #104554; } .accent-color-2 { background: #833333; } .accent-color-3 { background: #FFD31E; } /* Texture swatches -------------------- */ [class*="texture-swatch-"] { overflow: hidden; height: 8em; border: 4px solid white; box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.25); border-radius: 0; } .texture-swatch-1 { background: url("http://subtlepatterns.subtlepatterns.netdna-cdn.com/patterns/pw_maze_white.png") top left repeat; } .texture-swatch-2 { background: url("https://subtlepatterns.com/patterns/white_paperboard.png") top left repeat; } .texture-swatch-3 { background: url("http://subtlepatterns.subtlepatterns.netdna-cdn.com/patterns/subtle_grunge.png") top left repeat; } /* Buttons --------------------- */ [class*="button-"] { display: inline-block; position: relative; margin-right: 1em; margin-bottom: 1em; } .button-1 { padding: 1em 1em 1em 3em; border-radius: 4px; background: #104554; text-align: center; text-decoration: none; font: 1.25em/1 "Open Sans", sans-serif; letter-spacing: 1px; color: white; transition: all .3s ease; position: relative; margin-top: 10px; font-weight: 400; -moz-box-shadow: #0c343f 2px 3px 2px; -webkit-box-shadow: #0c343f 2px 3px 2px; box-shadow: #0c343f 2px 3px 2px; } .button-1:hover { background: #145769; -moz-box-shadow: #0f4250 2px 3px 2px; -webkit-box-shadow: #0f4250 2px 3px 2px; box-shadow: #0f4250 2px 3px 2px; } .button-1:after { font-family: FontAwesome; position: absolute; display: inline-block; content: "\f00c"; top: 0; left: -4px; width: 40px; height: 100%; font-weight: normal; line-height: 26px; border-radius: 4px 0 0 4px; background: #0c333f; text-align: center; padding-top: 13px; font-size: 18px; color: #1c7a94; transition: all .2s ease; } .button-1:hover:after { background: #104554; } .button-2 { padding: 1em 3em 1em 1em; border-radius: 4px; background: #a2a2a2; text-align: left; text-decoration: none; font: 1.25em/1 "Open Sans", sans-serif; letter-spacing: 1px; color: white; transition: all .2s ease; position: relative; -moz-box-shadow: #7a7a7a 2px 3px 2px; -webkit-box-shadow: #7a7a7a 2px 3px 2px; box-shadow: #7a7a7a 2px 3px 2px; } .button-2:hover { background: #7b7b7b; -moz-box-shadow: dimgray 2px 3px 2px; -webkit-box-shadow: dimgray 2px 3px 2px; box-shadow: dimgray 2px 3px 2px; } .button-2:after { font-family: FontAwesome; position: absolute; display: inline-block; content: "\f054"; top: 0; right: -4px; width: 40px; height: 100%; font-weight: normal; line-height: 26px; border-radius: 0 4px 4px 0; background: #959595; text-align: center; padding-top: 13px; font-size: 18px; color: #c8c8c8; transition: all .2s ease; } .button-2:hover:after { background: #626262; } /* Typography samples --------------------- */ .typography-samples { background: #fff; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; padding: 20px !important; } @media (min-width: 50em) { .typography-samples { padding: 20px; } } h3.typography-sample { font: 2.4em/1.25 "Open Sans", sans-serif; margin-bottom: .25em; color: #4d4d4d; } h4.typography-sample { font: 1.5em/1.25 "Open Sans", serif; margin-bottom: .25em; color: #104554; font-weight: 100; } p.typography-sample { font: 1em/1.5 "Open Sans", serif; color: #4d4d4d; } p.typography-sample strong { font-weight: 600; } p.typography-sample em { font-style: italic; } a.typography-sample { font: 1em "Open Sans", sans-serif; color: #9d0000; text-decoration: none; border-bottom: 1px solid #9d0000; } a.typography-sample:hover { color: #6a0000; transition: all .3s ease; } p[class*="font-details-"] { margin-top: .5em; margin-bottom: 2em; font: 0.75em/1 "Open Sans", serif; color: #9a9a9a; } p[class*="font-details-"] .font-color { font-style: italic; } /* Adjectives -------------------- */ .adjective-1 { font: italic 1.6em/1 "Open Sans", sans-serif; color: #222; } .adjective-2 { font: bold 1.25em/1.25 "Open Sans", serif; color: #104554; } .adjective-3 { font: 1.5em/1 "Open Sans", sans-serif; color: #dfdddc; } .adjective-4 { font: 1.6em/1.15 "Open Sans", sans-serif; color: #500000; } .adjective-5 { font: bold italic 3em/0.7 "Open Sans", sans-serif; color: #a2a2a2; } .adjective-6 { font: bold italic 1.8em/1.1 "Open Sans", serif; color: #fff; } /* Footer -------------------- */ .footer-wrapper { background: #d3d0cf; } footer { padding: 20px; font: italic 1em/1.5 "Open Sans", sans-serif; color: #4d4d4d; } footer a { font-weight: bold; color: #fff; text-decoration: none; } /* Grids based on Chris Coyier's Dont Overthink It Grids https://css-tricks.com/dont-overthink-it-grids/ -------------------- */ [class*='col-'] { float: left; } .grid:after { content: ""; display: table; clear: both; } .col-1-2 { width: 100%; /* Single-column by default, i.e., on mobile */ } @media (min-width: 50em) { .col-1-2 { /* 2-column if viewport is wide enough*/ width: 47%; margin-right: 4%; } } .col-1-2:last-child { margin-right: 0; } .col-1-3 { width: 100%; } @media (min-width: 50em) { .col-1-3 { width: 33.3333%; } } [class*="col-"] { padding: 0; } @media (min-width: 50em) { [class*="col-"] { padding-left: 30px; } } [class*="col-"]:first-child { padding-left: 0; } /* Swatch grids [Want to add more swatch grid column options? Formula for calculating swatch width: width: (100% - ($swatch-margin * (y - 1))) / y; where y = number of swatches in a grid row] */ [class*='swatch-'] { float: left; } .swatchgrid:after { content: ""; display: table; clear: both; } .swatch-1-2 { width: 49%; } .swatch-1-3 { width: 32%; } .swatch-1-4 { width: 23.5%; } .swatch-1-5 { width: 18.4%; } [class*="swatch-"] { margin-left: 2%; } [class*="swatch-"]:first-child { margin-left: 0; }

Style tiles with SCSS - Script Codes JS Codes

/* _____,-----------------------,_____ \ | STYLE TILES WITH SCSS | / /____|-----------------------|____\
by Jerad Gallinger - jeradgallinger.ca
twitter.com/jeradg - codepen.io/jeradg ___________________________________
|,---------------------------------,|
|| +-------+ +-------+ +-------+ ||
|| +-------+ | | | | ||
|| | | | | ||
|| +-------+ +-------+ +-------+ ||
|| +-------+ +-------+ +-------+ ||
|| | | | \ | | | ||
|| | | | \ | | | ||
|| +-------+ +-------+ +-------+ ||
||_________________________________||
'-----------------------------------'
On GitHub:
github.com/jeradg/style-tiles-with-scss
--
Based on Samantha Warren's Style Tiles:
http://styletil.es/
http://www.alistapart.com/articles/style-tiles-and-how-they-work/
--
A brief explanation:
- Start at the top for the most basic options, and move down for more fine-grained styling.
- The SCSS is sectioned into (from top -> bottom): - BASIC STYLING: main colors, basic typography, textures, and button styling. - ADVANCED STYLING: Advanced options for the above items. If you want to make fancy buttons, do cool things with the texture boxes, or have fine-grained control over the typography samples and adjectives, do it here. - SETTINGS - Below the settings, everything comes together in the proper order to be compiled.
Play around! Use SCSS and Compass's colour functions to create colour schemes, try to do fancy stuff in the texture boxes, mess about with floats and margins to customize the layout -- make it your own.
And don't forget -- SAVE OFTEN!
*/
/* (And now for some JavaScript... let's hear it for progressive enhancement.)
*/
$( document ).ready( function() {
/* setHeight() keeps the swatches as squares by setting each swatch's height on document load, and updating it when the viewport is resized. */ var swatchGrids = $( ".swatchgrid" ); var setHeight = function( elements ) { $( elements ).each( function() { var firstChild = $( this ).find( ":first-child" ); $( this ).children().each( function() { $( this ).height( $( firstChild ).width() ); }); }); }; setHeight( swatchGrids ); $( window ).resize( function() { setHeight( swatchGrids ); });
/* updateFontDetails() changes the HTML of each .font-details-* on document load to reflect the styles of the immediately preceding .typography-sample. This allows you to update the styles of the typography samples on the fly without having to manually enter these details into the HTML. */ var updateFontDetails = function() { $( ".typography-sample" ).each( function() { var thisSample = $( this ); var getFontName = function( sample ) { var splitFontStack = sample.css( "font-family" ).split( "," ); var justTheName = function() { var rawFontName = splitFontStack[ 0 ]; //Get the first font-family from the font stack if ( rawFontName.charAt( 0 ) == "\'" | "\"" ) { return rawFontName.substring( 1, rawFontName.length - 1 ); //Remove the quotes from around the font-family name, if there are any } else { return rawFontName; } }; return justTheName(); }; var fontName = getFontName( thisSample ); var fontColor = thisSample.css( "color" ); var fontDetails = thisSample.next( "[class*=font-details-]" ); fontDetails.children( ".font-name" ).html( fontName ); fontDetails.children( ".font-color" ).html( fontColor ); }); }; updateFontDetails();
});
Style tiles with SCSS - Script Codes
Style tiles with SCSS - Script Codes
Home Page Home
Developer Xavier Porter
Username xporter
Uploaded October 27, 2022
Rating 3
Size 13,579 Kb
Views 14,168
Do you need developer help for Style tiles with SCSS?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Xavier Porter (xporter) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!