Style tiles with SCSS

Developer
Size
12,087 Kb
Views
4,048

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 Michel Balzer on 18 January 2023, Wednesday.

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"> <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,400,800);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif: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: white; font: 1.6em "Droid Serif", serif; line-height: 1.5;
}
header, .main, footer { max-width: 1300px; margin: 0 auto;
}
/* Header
-------------------- */
.header-wrapper { background: #9f1c19;
}
header { padding: 20px; background: #9f1c19;
}
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 "Droid Serif", serif; color: rgba(255, 255, 255, 0.95);
}
.project-title { position: relative; float: left;
}
/* Main
-------------------- */
.main { padding: 20px; background: white;
}
.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);
}
.color-swatch-1 { background: #9f1c19;
}
.color-swatch-2 { background: #65d1fb;
}
.color-swatch-3 { background: #05abeb;
}
.color-swatch-4 { background: #ff8500;
}
.color-swatch-5 { background: #ff241f;
}
/* 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);
}
.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; border-radius: 4px; background: #05abeb; text-align: center; text-decoration: none; font: bold 1.25em/1 "Open Sans", sans-serif; letter-spacing: 1px; color: white; text-transform: uppercase; text-shadow: 0px -1px 0px #0374a0; transition: all .2s ease;
}
.button-1:hover { background: #0374a0;
}
.button-2 { padding: 1em; border-radius: 4px; background: #ff241f; text-align: center; text-decoration: none; font: bold 1.25em/1 "Open Sans", sans-serif; letter-spacing: 1px; color: white; text-transform: uppercase; text-shadow: 0px -1px 0px #d20500; transition: all .2s ease;
}
.button-2:hover { background: #d20500;
}
/* Typography samples
--------------------- */
.typography-samples { background: white; padding: 0;
}
@media (min-width: 800px) { .typography-samples { padding: 20px; }
}
h3.typography-sample { font: bold 2.4em/1.25 "Open Sans", sans-serif; margin-bottom: .25em; color: #363636;
}
h4.typography-sample { font: italic 1.5em/1.25 "Droid Serif", serif; margin-bottom: .25em; color: #363636;
}
p.typography-sample { font: 1em/1.5 "Droid Serif", serif; color: #222;
}
p.typography-sample strong { font-weight: bold;
}
p.typography-sample em { font-style: italic;
}
a.typography-sample { font: bold 1em "Open Sans", sans-serif; color: #05abeb; text-decoration: none;
}
a.typography-sample:hover { color: #0088bd;
}
p[class*="font-details-"] { margin-top: .5em; margin-bottom: 2em; font: 0.75em/1 "Droid Serif", serif; color: #6f6f6f;
}
p[class*="font-details-"] .font-color { font-style: italic;
}
/* Adjectives
-------------------- */
.adjective-1 { font: italic 1.6em/1 "Open Sans", sans-serif; color: #9f1c19;
}
.adjective-2 { font: bold 1.25em/1.25 "Droid Serif", serif; color: #05abeb;
}
.adjective-3 { font: 1.5em/1 "Open Sans", sans-serif; color: #ff8500;
}
.adjective-4 { font: 1.6em/1.15 "Open Sans", sans-serif; color: #65d1fb;
}
.adjective-5 { font: bold italic 3em/0.7 "Open Sans", sans-serif; color: #ff241f;
}
.adjective-6 { font: bold italic 1.8em/1.1 "Droid Serif", serif; color: #05abeb;
}
/* Footer
-------------------- */
.footer-wrapper { background: white;
}
footer { padding: 20px; font: italic 1em/1.5 "Open Sans", sans-serif; color: #222;
}
footer a { font-weight: bold; color: #05abeb; 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: 800px) { .col-1-2 { /* 2-column if viewport is wide enough*/ width: 50%; }
}
.col-1-3 { width: 100%;
}
@media (min-width: 800px) { .col-1-3 { width: 33.3333%; }
}
[class*="col-"] { padding: 0;
}
@media (min-width: 800px) { [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>Style Tile<br>Template</h1> <hgroup class="project-title"> <h2>Project name</h2> <h3>Style tile</h3> <h4>Version 1</h4> </hgroup> </header>
</div>
<div class="main grid"> <div class="graphic-samples col-1-2"> <section class="swatches group"> <h3 class="section-heading">Colour 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> </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">Button 1</a> <a href="#" class="button-2">Button 2</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">Lorem</p> <p class="adjective-2 col-1-3">Ipsum</p> <p class="adjective-3 col-1-3">Dolor</p> </div> <div class="grid group"> <p class="adjective-4 col-1-3">Magna</p> <p class="adjective-5 col-1-3">Amet</p> <p class="adjective-6 col-1-3">Sit</p> </div> </section> </div>
</div>
<div class="footer-wrapper"> <footer class="group"> <small> Style tile by Jerad Gallinger.<br> <a href="http://jeradgallinger.ca">jeradgallinger.ca</a> </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,400,800);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif: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: white; font: 1.6em "Droid Serif", serif; line-height: 1.5; } header, .main, footer { max-width: 1300px; margin: 0 auto; } /* Header -------------------- */ .header-wrapper { background: #9f1c19; } header { padding: 20px; background: #9f1c19; } 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 "Droid Serif", serif; color: rgba(255, 255, 255, 0.95); } .project-title { position: relative; float: left; } /* Main -------------------- */ .main { padding: 20px; background: white; } .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); } .color-swatch-1 { background: #9f1c19; } .color-swatch-2 { background: #65d1fb; } .color-swatch-3 { background: #05abeb; } .color-swatch-4 { background: #ff8500; } .color-swatch-5 { background: #ff241f; } /* 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); } .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; border-radius: 4px; background: #05abeb; text-align: center; text-decoration: none; font: bold 1.25em/1 "Open Sans", sans-serif; letter-spacing: 1px; color: white; text-transform: uppercase; text-shadow: 0px -1px 0px #0374a0; transition: all .2s ease; } .button-1:hover { background: #0374a0; } .button-2 { padding: 1em; border-radius: 4px; background: #ff241f; text-align: center; text-decoration: none; font: bold 1.25em/1 "Open Sans", sans-serif; letter-spacing: 1px; color: white; text-transform: uppercase; text-shadow: 0px -1px 0px #d20500; transition: all .2s ease; } .button-2:hover { background: #d20500; } /* Typography samples --------------------- */ .typography-samples { background: white; padding: 0; } @media (min-width: 800px) { .typography-samples { padding: 20px; } } h3.typography-sample { font: bold 2.4em/1.25 "Open Sans", sans-serif; margin-bottom: .25em; color: #363636; } h4.typography-sample { font: italic 1.5em/1.25 "Droid Serif", serif; margin-bottom: .25em; color: #363636; } p.typography-sample { font: 1em/1.5 "Droid Serif", serif; color: #222; } p.typography-sample strong { font-weight: bold; } p.typography-sample em { font-style: italic; } a.typography-sample { font: bold 1em "Open Sans", sans-serif; color: #05abeb; text-decoration: none; } a.typography-sample:hover { color: #0088bd; } p[class*="font-details-"] { margin-top: .5em; margin-bottom: 2em; font: 0.75em/1 "Droid Serif", serif; color: #6f6f6f; } p[class*="font-details-"] .font-color { font-style: italic; } /* Adjectives -------------------- */ .adjective-1 { font: italic 1.6em/1 "Open Sans", sans-serif; color: #9f1c19; } .adjective-2 { font: bold 1.25em/1.25 "Droid Serif", serif; color: #05abeb; } .adjective-3 { font: 1.5em/1 "Open Sans", sans-serif; color: #ff8500; } .adjective-4 { font: 1.6em/1.15 "Open Sans", sans-serif; color: #65d1fb; } .adjective-5 { font: bold italic 3em/0.7 "Open Sans", sans-serif; color: #ff241f; } .adjective-6 { font: bold italic 1.8em/1.1 "Droid Serif", serif; color: #05abeb; } /* Footer -------------------- */ .footer-wrapper { background: white; } footer { padding: 20px; font: italic 1em/1.5 "Open Sans", sans-serif; color: #222; } footer a { font-weight: bold; color: #05abeb; 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: 800px) { .col-1-2 { /* 2-column if viewport is wide enough*/ width: 50%; } } .col-1-3 { width: 100%; } @media (min-width: 800px) { .col-1-3 { width: 33.3333%; } } [class*="col-"] { padding: 0; } @media (min-width: 800px) { [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 Michel Balzer
Username michelbalzer
Uploaded January 18, 2023
Rating 3
Size 12,087 Kb
Views 4,048
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!

Michel Balzer (michelbalzer) Script Codes
Create amazing love letters 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!