css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <!-- GRID -->
<div class="wrapper">
	
	<!-- HEADER -->
	<p class="head">hover on the pictures</p>
	
	<!-- MAIN -->
	
	<!-- BLACK TO INVERT -->
	<div class="div black invert">
		<button><div></div></button>
		<p>black to <span>white</span></p>
	</div>
	<!-- BLACK TO COLOR -->
	<div class="div black color">
		<button><div></div></button>
		<p>black to <span>color</span>*</p>
	</div>
	
	<!-- WHITE TO INVERT -->
	<div class="div white invert">
		<button><div></div></button>
		<p>white to <span>black</span></p>
	</div>
	<!-- WHITE TO COLOR -->
	<div class="div white color">
		<button><div></div></button>
		<p>white to <span>color</span>*</p>
	</div>
	
	<!-- FOOTER -->
	<p class="foot">*Please, consider playing with the <span>$bg-color</span> and the <span>$color</span> in the CSS.  Changing to some colors will require more adjustements to work properly.</p>
	
</div>
<!-- THE END -->
            
          
!
            
              @import url("https://fonts.googleapis.com/css?family=Lato")
@import "susy"
@import "breakpoint"
	
//== SETUP ==================================================
$bg: teal

@mixin hover($c)
	border: solid 1px $c
	background-color: fade-out($c, 0.8)

//===========================================================
//== WHITE TO COLOR ========================================
//===========================================================

$icon-white: red 
white-span
	color: $icon-white
white
	@include hover($icon-white)
	&::before, &::after
		//-- for white you need to get the opposite color -------
		background: invert($icon-white)
//-----------------------------------------------------------

//-- UNCOMMENT TO TRY OTHER COLORS AND ADJUSTMENT -----------

//-- exemple with pink ------------------------------------
//$icon-white-adjust: pink //-- change & see below
//white-adjust-span
//	color: $icon-white-adjust
//white-adjust
//	@include hover($icon-white-adjust)
//	&::after
//		background: invert($icon-white-adjust)		
//	&::before
//		background: adjust-color($bg, $lightness: 12.3%, $hue: -3)
//		mix-blend-mode: normal
//-----------------------------------------------------------

//-- exemple with goldenrod -------------------------------
//$icon-white-adjust: goldenrod //-- change & see below
//white-adjust-span
//	color: $icon-white-adjust
//white-adjust
//	@include hover($icon-white-adjust)
//	&::after
//		background: invert($icon-white-adjust)		
//	&::before
//		background: adjust-color($bg, $hue: -38, $saturation: -30, $lightness: 25.5)
//		mix-blend-mode: normal
//-----------------------------------------------------------

//===========================================================
//== BLACK to COLOR ========================================
//===========================================================

$icon-black: red
black-span
	color: $icon-black
black
	@include hover($icon-black)
	&::before, &::after
		background: $icon-black
//-----------------------------------------------------------

//-- uncomment this section to check the adjustments --------
$icon-black-adjust: goldenrod
//black-adjust-span
//	color: $icon-black-adjust
//black-adjust
//	@include hover($icon-black-adjust)
//	&::before
//		background: change-color($bg, $hue: 295, $lightness: 84.5%)
//		mix-blend-mode: difference
//	&::after
//		background: $icon-black-adjust
//-----------------------------------------------------------

//===========================================================
//== IMAGES STYLING =========================================
//===========================================================

//== BLACK ==================================================
.black
	color: black
	button
		@include hover(black)
		div
			background: url("https://upload.wikimedia.org/wikipedia/commons/b/b9/FP_Mushroom_icon.svg") center no-repeat
			background-size: contain

//-- TO INVERT ----------------------------------------------
.black.invert
	span
		color: white
	button
		&:hover
			@include hover(white)
			&::before, &::after
				background-color: white

//-- TO COLOR -----------------------------------------------
.black.color
	span
		@extend black-span
		@extend black-adjust-span !optional
	button
		&:hover
			@extend black
			@extend black-adjust !optional
//-----------------------------------------------------------

//== WHITE ==================================================

.white
	color: white
	button
		@include hover(white)
		div
			background: url(https://upload.wikimedia.org/wikipedia/commons/d/db/Sun_white_icon.svg) center no-repeat
			background-size: contain

//-- TO INVERT ----------------------------------------------
.white.invert
	span
		color: black
	button
		&:hover
			@include hover(black)
			&::before, &::after
				//-- for white you need the opposite color ---------
				background-color: white

//-- TO COLOR -----------------------------------------------
.white.color
	span
		@extend white-span
		@extend white-adjust-span !optional
	button
		&:hover
			@extend white
			@extend white-adjust !optional
//-----------------------------------------------------------


//===========================================================
//== RESPONSIVE GRID SUZY+BREAKPOINT========================
//===========================================================

$bp0: 0px
$bp1: 450px
$bp2: 600px
$bp3: 800px
$bp4: 1000px

$susy: (gutters: 1/4, gutter-position: split)
//-----------------------------------------------------------

.wrapper
	width: 90%
	@include breakpoint($bp0)
		min-width: (0.9*$bp1)
	@include breakpoint($bp1)
		max-width: (0.8*$bp2)
	@include breakpoint($bp2)
		max-width: (0.6*$bp3)
	@include breakpoint($bp3)
		max-width: (0.9*$bp4)
//-----------------------------------------------------------
		
.foot
	@include span(100%)
	@include breakpoint($bp0)
		font-size: 10px
	@include breakpoint($bp1)
		font-size: 11px
	@include breakpoint($bp2)
		font-size: 12px
	@include breakpoint($bp3)
		font-size: 14px
	@include breakpoint($bp4)
		font-size: 16px
//-----------------------------------------------------------

.head
	@include span(100%)
	@include breakpoint($bp0)
		font-size: 24px
		margin: 5% 0
	@include breakpoint($bp1)
		font-size: 26px
		margin: 3% 0
	@include breakpoint($bp2)
		font-size: 30px
		margin: 3% 0
	@include breakpoint($bp3)
		font-size: 36px
		margin: 5% 0
//-----------------------------------------------------------
	
.div
	@include span(1 of 2)
	@include breakpoint($bp0)
		font-size: 13px
	@include breakpoint($bp1)
		font-size: 14px
	@include breakpoint($bp2)
		font-size: 15px
	@include breakpoint($bp3)
		font-size: 16px
		@include span(1 of 4)
		margin-bottom: gutter(4)

//===========================================================
//== GENERAL STYLING =======================================
//===========================================================

html, body
	height: 100%
	width: 100%
	background-color: $bg
	font-family: 'Lato', sans-serif
	text-transform: uppercase
	text-align: center
	.wrapper
		height: 100%
		margin: 0 auto
		position: relative
		.head
			font-weight: bold
			text-shadow: -1px -1px lighten($bg, 16%), -1px 0 lighten($bg, 10%), 0 -1px lighten($bg, 10%), 1px 0 darken($bg, 10%), 1px 1px darken($bg, 16%), 0 1px darken($bg, 10%)
			color: lighten($bg, 4%)
			letter-spacing: 4px
		.div
			position: relative
			&::before
				padding-top: 100%
				display: block
				content: ""
			p
				position: absolute
				bottom: 0
				left: 0
				width: 100%
			button
				position: absolute
				top: 0
				left: 10%
				cursor: pointer
				width: 80%
				height: 75%
				padding: 10% 0
				div
					height: 100%
					position: relative
				&::after, &::before
					mix-blend-mode: difference
					position: absolute
					top: 0
					left: 0
					width: 100%
					height: 100%
					content: ""
	.foot
		span
			font-weight: bold
	
//== THE END ================================================
            
          
!
            
              //        Please let me know
//          if it's useful
//    or if you have suggestions
//         to improve it! :)

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console