Milligram provides a minimal setup of styles for a fast and clean starting point. Just it! Only 2kb gzipped! It's not about a UI framework. Specially designed for better performance and higher productivity with fewer properties to reset resulting in cleaner code. Hope you enjoy!
Just-add-water CSS animations
Shoelace.css is a lightweight, forward-thinking CSS library built with future CSS syntax. It’s easy to use and highly customizable. Bootstrap users will find it familiar, yet refreshing.
You can use Shoelace with just about any browser. The CDN version is great for prototyping, but to take advantage of all its features you should build Shoelace from source.
Block Element Modifier is a methodology that helps you to create reusable components and code sharing in front-end development
To use BEM, you only need to employ BEM’s naming convention.
Independent blocks and CSS selectors make your code reusable and modular.
Using BEM, methodologies and tools can be recomposed and configured the way you like.
CSS Grid Layout is a game-changer for web developers. Learn more about CSS Grid and the CSS Grid Layout panel in Firefox.
Thoughts about front-end development and design. And probably other ramblings by Una Kravets.
.my-text {
text-shadow: 0 0 10px rgba(255,255,255,1) ,
0 0 20px rgba(255,255,255,1) ,
0 0 30px rgba(255,255,255,1) ,
0 0 40px #ff00de ,
0 0 70px #ff00de ,
0 0 80px #ff00de ,
0 0 100px #ff00de ;
}
The CSS box-shadow property is deceptively awesome. When used “traditionally”, it’s a simple way to add a shadow effect to an element. I use this for images in my blog. It’s nice. But get saucier with it and you can pull off some really interesting things. I’ve already talked about the pixel art hack. This time I’m going to share how to create colorful glow effects.
The demo page for Pure CSS speech bubbles.
For a detailed explanation view the CSS file. It is heavily commented.
All examples use simple, semantic HTML. No empty elements, no unnecessary extra elements, no JavaScript, no images (apart from that Twitter logo). Have a look at the source code.
The lack of good ways to vertically center elements in CSS has been a dark blemish on its reputation for pretty much its entire existence.
What makes matters worse is the techniques that do work for vertical centering are obscure and unintuitive, while the obvious choices (like vertical-align:middle
) never seem to work when you need them.
The current landscape of vertical centering options ranges from negative margins to display:table-cell
to ridiculous hacks involving full-height pseudo-elements. Yet even though these techniques sometimes get the job done, they don’t work in every situation. What if the thing you want to center is of unknown dimensions and isn’t the only child of its parent? What if you could use the pseudo-element hack, but you need those pseudo-elements for something else?
With Flexbox, you can stop worrying. You can align anything (vertically or horizontally) quite painlessly with the align-items
, align-self
, and justify-content
properties.
Learn by example: cssreference.io is a free visual guide to CSS. It features the most popular properties, and explains them with illustrated and animated examples.
Beautify, unpack or deobfuscate JavaScript and HTML, make JSON/JSONP readable, etc.
All of the source code is completely free and open, available on GitHub under MIT licence,
and we have a command-line version, python library and a node package as well.
web-beautify is a formatting package of HTML, CSS and JavaScript/JSON for Emacs. It uses the command-line/node.js javascript formatter from http://jsbeautifier.org/ to format whole html, css, js or json files, or region.
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Not only that, we can do one better by using vw
and calc
.
Simply set the width of the child elements to be 100% of the viewport width by using vw
(percentage viewport units), and then set their left margin to a negative calculated value based on this, minus the width of the wrapper. Other than the optional max-width
of the parent, everything else is calculated automatically. You can dynamically change the width of the parent container, and the children will automatically resize and align as needed, without being positioned.
<!-- begin snippet: js hide: false -->
<!-- language: lang-css -->
body,
html,
.parent {
height: 100%;
width: 100%;
text-align: center;
padding: 0;
margin: 0;
}
.parent {
width: 50%;
max-width: 800px;
background: grey;
margin: 0 auto;
position: relative;
}
.child {
width: 100vw;/* <-- children as wide as the browser window (viewport) */
margin-left: calc(-1 * ((100vw - 100%) / 2));/* align left edge to the left edge of the viewport */
/* The above is basically saying to set the left margin to minus the width of the viewport MINUS the width of the parent, divided by two, so the left edge of the viewport */
height: 50px;
background: yellow;
}
vw
and calc()
.Set the width
of the child element to 100% of the viewport width, or 100vw
. Then move the child element 50% of the viewport width – minus 50% of the parent element's width – to the left to make it meet the edge of the screen.
.child-element {
position: relative;
width: 100vw;
left: calc(-50vw + 50%);
}
With this, the position
type of the parent element doesn't matter and the child element is still part of the content flow.
Browser support for vw and for calc() can generally be seen as IE9+.
Note: This assumes the box model is set to border-box
. Without border-box
, you'll also have to subtract paddings and borders, making this solution a mess.
position: absolute;
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
It will stick to the bottom of the viewport on short pages, or stretch down on long pages.
Look up HTML5, CSS3, etc features, know if they are ready for use, and if so find out how you should use them – with polyfills, fallbacks or as they are.
Remembering what CSS to prefix
is hard. Today browsers develop quickly (yay) and things often change (boo). Preprocessors and mixin libraries are not always up to date.
This page has one purpose: simply show what prefixes are needed for a newer CSS property. Need more information? Check the awesome Can I Use or Autoprefixer!
Not only that, we can do one better by using vw
and calc
.
Simply set the width of the child elements to be 100% of the viewport width by using vw
(percentage viewport units), and then set their left margin to a negative calculated value based on this, minus the width of the wrapper. Other than the optional max-width
of the parent, everything else is calculated automatically. You can dynamically change the width of the parent container, and the children will automatically resize and align as needed, without being positioned.
Adding #HTML entities using #CSS content and escaped #unicode: useful when you can't use @fontawesome
Also see http://unicode-table.com/