HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
//-Jade Mixins
mixin card(number, name)
.card
.number
span #{number}
.img
.product-name
span #{name}
.overlay
.detail
span Details
span.fa.fa-pencil
//- End of Mixins
.container
.box
.left-bar
span.fa.fa-cloud-download
.menu-group
span.fa.fa-television
span.fa.fa-shopping-cart.active
.building
span.fa.fa-building
span.fa.fa-building
span.fa.fa-cog
span.fa.fa-sign-out
.wrapper
.top-bar
span.cloud Cloud Inventory
.cta-button
span +
.content
.menu
.search
label
span.fa.fa-search
input( placeholder= 'Search Items')
.list-info
span 29 Items
span.fa.fa-bars
span.fa.fa-th-large
.grid
+card('1', 'Air Nike Tenis')
+card('2', 'Nike T-Shirt Black')
+card('3', 'Air Nike Tenis')
+card('4', 'Air Nike Tenis')
+card('5', 'Air Nike Tenis')
+card('6', 'Air Nike Tenis')
+card('7', 'Air Nike Tenis')
+card('8', 'Air Nike Tenis')
+card('9', 'Air Nike Tenis')
+card('10', 'Air Nike Tenis')
+card('11', 'Air Nike Tenis')
+card('12', 'Air Nike Tenis')
@import 'https://fonts.googleapis.com/css?family=Lato'
/* Variables */
$lato: 'Lato', sans-serif
$orange: #FF4E2D
$red: #FF2C55
// $gradient:
/* End of Variables */
*
padding: 0
margin: 0
html
-webkit-box-sizing: border-box
-moz-box-sizing: border-box
box-sizing: border-box
*
text-rendering: optimizeLegibility
-webkit-font-smoothing: antialiased
-moz-osx-font-smoothing: grayscale
html,body
width: 100%
height: 100%
font-family: $lato
*, *:before, *:after
-webkit-box-sizing: inherit
-moz-box-sizing: inherit
box-sizing: inherit
/* End Resets */
.container
background-color: pink
width: 100%
height: 100%
display: flex
justify-content: center
align-items: center
.box
width: 1100px
height: 900px
background-color: white
display: flex
flex-flow: row nowrap
// flex: 1
.left-bar
position: relative
z-index: 5
width: 80px
height: 100%
background: #FF4E50 /* fallback for old browsers */
background: -webkit-linear-gradient(180deg, #FF2C55 , #FF4E2D) /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(180deg, #FF2C55 , #FF4E2D) /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
display: flex
// justify-content: space-around
flex-direction: column
align-items: center
span
padding: 5px
> span
cursor: pointer
transform: scale(1,1)
transition: all ease-in-out 150ms
&:hover
transform: scale(1.2,1.2)
& > span
&:first-child
margin-top: 20px
color: white
font-size: 26px
&:last-child
color: rgba(white, 0.7)
margin-top: 500px
font-size: 20px
.menu-group
height: 200px
display: flex
flex-direction: column
align-items: center
justify-content: space-between
margin-top: 70px
& > span
color: rgba(white , 0.5)
cursor: pointer
transform: scale(1)
transition: all ease-in-out 150ms
&:hover
transform: scale(1.2,1.2)
.active
color: white
&:after
content: ''
position: absolute
// width: 5px
// height: 5px
margin-left: 3px
margin-top: -4px
padding: 4px
background-color: yellow
border-radius: 50%
box-shadow: 0 0 5px 2px rgba(yellow, 0.5)
.building
font-size: 14px
display: flex
color: rgba(white, 0.5)
transform: scale(1)
transition: all ease-in-out 150ms
cursor: pointer
padding: 5px
&:hover
transform: scale(1.2,1.2)
> span
padding: 0
&:nth-child(1)
font-size: 10px
align-self: flex-end
&.active
&:after
content: ''
position: absolute
margin-left: 22px
margin-top: -4px
padding: 4px
background-color: yellow
border-radius: 50%
box-shadow: 0 0 5px 2px rgba(yellow, 0.5)
.wrapper
flex: 1
.top-bar
position: relative
display: flex
height: 60px
align-items: center
border-bottom: 1px solid rgba(black , 0.05)
box-shadow: 0px 3px 5px rgba(black, 0.08)
// background-color: teal
> span
margin-left: 30px
font-weight: bold
letter-spacing: 2px
color: $red
.cta-button
cursor: pointer
position: absolute
bottom: -45%
right: 3.5%
width: 50px
height: 50px
background-color: $red
border-radius: 50%
display: flex
justify-content: center
align-items: center
box-shadow: 0 0 4px rgba(0,0,0,.14),0 4px 8px rgba(0,0,0,.28)
transition: all ease-in-out 150ms
&:hover
box-shadow: 0 6px 12px rgba(0,0,0,.46)
transform: translateY(-5px)
> span
color: white
font-size: 30px
.menu
// background-color: teal
height: 50px
display: flex
align-items: center
justify-content: space-between
margin-top: 45px
span
color: $red
&:nth-child(n+2)
cursor: pointer
.search
margin-left: 30px
input
margin-left: 15px
border: none
.list-info
margin-right: 30px
span
&:nth-child(1)
margin-right: 40px
&:nth-child(2)
margin-right: 20px
.grid
// margin-top: 15px
display: flex
flex-wrap: wrap
justify-content: space-between
padding-left: 25px
padding-right: 25px
.card
position: relative
display: flex
flex-direction: column
justify-content: center
align-items: center
border-radius: 3px
width: 21%
height: 195px
margin: 15px 0 30px
box-shadow: 0 2px 15px 0px rgba(black, 0.2)
&:hover
.overlay
opacity: 1
.number
z-index: 6
position: absolute
top: 10px
left: 10px
display: flex
background-color: $red
width: 30px
height: 30px
border-radius: 50%
align-items: center
justify-content: center
box-shadow: 0 3px 7px 1px rgba($red, 0.5)
> span
color: white
font-weight: bold
.overlay
opacity: 0
background: #FF4E50 /* fallback for old browsers */
background: -webkit-linear-gradient(90deg, rgba(#FF2C55 , 0.7) , rgba(#FF4E2D, 0.7)) /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(90deg, rgba(#FF2C55 , 0.7) , rgba(#FF4E2D, 0.7))
width: 100%
height: 100%
border-radius: 3px
position: absolute
top: 0
left: 0
transition: all ease-in-out 200ms
display: flex
justify-content: center
align-items: center
flex-direction: column
flex-wrap: wrap
.img
background-color: pink
height: 50%
width: 80%
display: flex
justify-content: center
align-items: center
img
width: 160px
height: 130px
// height: 100%
.product-name
font-family: $lato
font-weight: bold
color: $red
margin-top: 10px
.detail
> span
cursor: pointer
&:nth-child(1)
width: 80%
height: 20px
background-color: transparent
padding: 10px 40px
border-radius: 50px
border: 3px solid white
color: white
&:nth-child(2)
color: white
position: absolute
top: 15px
right: 15px
font-size: 19px
// Hello!
// This is a on going project of mine called "CSS Dribler" where i take designs from dribbble, and make them into code, in order to hone my skills.
//Credits below
// Design By:
// - Muhammad Fauzi
// Link: https://dribbble.com/shots/2937822-Dashboard-Inventory
Also see: Tab Triggers