# data[].attributes.headline
Setting up your Windows computer with Node

# data[].attributes.subject
Setting up your Windows computer with Node

# data[].attributes.attachment_link.title
Setting up your Windows 10 machine to learn Javascript with NodeJS

# data[].attributes.body
Used to be free, now costs $9

# data[].attributes.attachment_link.description
An Introduction to Version Control with Git

# data[].attributes.attachment_link.description
Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential.

# data[].attributes.headline
The best JavaScript runtime environment! You need to know this.

# data[].attributes.subject
The best JavaScript runtime environment! You need to know this.

# data[].attributes.attachment_link.description
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.

# data[].attributes.attachment_link.description
Find out how well you know (or don't know) the JavaScript == operator rules

# data[].attributes.attachment_link.readable_text
If you don't want to be grouped in with bad recruiters, here's how to avoid it:

Stop all unsolicited outbound contact now.

I realize that spam works, but it's also not ethical. It's a major nuisance. It's also illegal in most cases. All unsolicited recruiter emails fall...

# data[].attributes.attachment_link.description
If you don't want to be grouped in with bad recruiters, here's how to avoid it: Stop all unsolicited outbound contact now. I realize that spam works, but it's also not ethical. It's a major nuisance. It's also illegal in most cases. All unsolicited recruiter emails fall...

# data[].attributes.attachment_link.title
CSS Inliner Tool | Email Design Reference

# data[].attributes.attachment_link.description
Some email clients strip out and tags from emails, so it's best to have your CSS written inline within your markup. We know that writing inline CSS is time consuming and repetitive, so we've built this conversion tool to automatically inline your email's CSS.

# data[].attributes.attachment_link.readable_text
Top free pics this week

Stunning stock images, perfect for blogs and websites

Browse high-resolution photo collections

Explore stock photography by category, all free for commercial use

Start a business

Most everything you need to get started - photos, suppliers, and more

Frequently asked questions

What is Burst?

Burst is a free stock photo platform that is powered by Shopify. Our image library includes thousands of high-resolution, royalty-free images that were shot by our global community of photographers. We built Burst to provide designers, developers, bloggers and entrepreneurs with access to beautiful free stock photography. You can use our pictures for just about anything - your website, blog or online store, school projects, Instagram ads, facebook posts, desktop backgrounds, client work and more. All our photos are free for commercial use with no attribution required; you can read more about this on our license page.

How do I download free photos?

When you hover over or click on an image, you will see "High Resolution" and "Low Resolution" download options. "Low Res" images are great for small web graphics, where file sizes need to be very compressed. "High Res" images are better for presentations, websites, online stores, and anywhere else where quality matters most.

Can I edit, crop or resize Burst photos?

Yes, you're welcome to crop, resize, add text and filters, or otherwise modify our stock photos as you see fit. If you don't have Photoshop, there are lots of free or low cost online graphics editors that you can use instead. Feel free to add your logo or brand to our images to make them your own.

Can I use these pictures for another online store platform?

Yes! We believe in making commerce better for everyone, so these stock photos are free to use on any online store platform or ecommerce marketplace. Although they were specifically created and curated with Shopify stores in mind, it's really up to you how you want to use them.

Do I need to credit the site or photographer?

Our photographers appreciate getting credit for their work because it helps share their photography with more people, so we'd encourage you to do so whenever possible. You can give credit by linking back to the original photo page or the photographer's Burst profile (e.g. "Photo by Matthew Henry from Burst"). We realize it's not always possible to provide attribution, so it is not mandatory under our image license.

Are these photos free for commercial use?

Yes! In fact, we'd highly encourage it, as many of our collections were created with entrepreneurs in mind. You can use these free photos on your online store, product packaging, or anywhere else you'd like. You can even use these pics to create t-shirts, mugs, or other products.

Can I use these photographs for offline marketing campaigns?

Of course. We'd be honored to have you feature our free stock photos on a billboard, flyer, menu or catalog.

I'd like to contribute photos. What types of images should I submit?

We're looking for high-resolution, professional images that can be used by designers, developers, bloggers and entrepreneurs. Our users are always eager for more pictures of animals, nature photos, textured shots and background images. If you think it's a compelling photograph, please send it our way.

# data[].attributes.attachment_link.title
20,000+ Free Stock Photos and Royalty-Free Images

# data[].attributes.attachment_link.description
Browse thousands of beautiful copyright-free images. All our pictures are free to download for personal and commercial use, no attribution required.

# data[].attributes.attachment_link.readable_text
If you use CSS in your daily work, your primary goal is probably focused around making things 'look right'. How this is achieved is often far less important than the end result. This means we care less about how CSS works than the correct syntax and visual results.

You may not have realised it, but the visual results of CSS are often an indirect consequence of manipulating hidden properties. Some CSS properties such as background-color have a direct and obvious relationship with what you see. While others such as display remain ambiguous to many of us because the results seem highly dependant on context.

I doubt many developers could describe in simple terms what setting display: block actually does. At best you probably have an intuitive understanding of how properties like this work. That's ok, you can have a pretty good wrangle of CSS without understanding the underlying principles. Although, this might be knowing the solution without necessarily understanding the problem.

If this describes you, that's ok. I learnt how to work with CSS, long before I understood how it worked. I guess that doesn't make it ok, ...but at least you're not alone!

The underlying features of CSS are complicated and intentionally abstracted, yet we can't be completely unaware of them. Concepts such as the Box Model, Cascade and Specificity will be familiar to many of us. Although they are often misunderstood, knowing a little of how these work can help us write better CSS.

The same can be said for many other hidden parts of CSS. The problem with understanding these better is that the barrier to entry is even higher. It often feels like nothing can be explained in isolation. You need to know everything before you can understand the smallest part of the process.

Because of this I want to attempt to shed some light on the invisible parts of CSS, touching only on what you need to know and hopefully explaining the process in a logical order, so that you can gain a better understand of how CSS actually works.

This is a long article so if you want to skip ahead to one of these sections, I'm totally fine with that:

Overview of the rendering process

When you load an HTML document there is a lot that happens in order for that page to render.

The first step is to parse the HTML document. From this the browser builds a 'document tree'. A tree structure is a way of representing information with an obvious hierarchy like HTML. Elements in a tree can be described in terms similar to a family tree, such as descendants, parents, children and siblings.

You might have heard the term DOM. This stands for Document Object Model. It is an extension of the document tree structure, and is used to store and manipulate information about the content of a web document.

As HTML is being parsed, stylesheets and other resources are fetched. Style declarations are interpreted and resolved through a process known as the Cascade.

During this process the final values of CSS properties are resolved. After calculation these values may be different to what is written in our stylesheets. For example keywords like auto and relative units are assigned real values, and inherited values are applied. These computed values are stored in a tree, similar to elements in the DOM, in what is unsurprisingly called the CSS Object Model or CSSOM.

It is now possible to begin the process of rendering the page. The first step in this process is the calculation of the Box Model. This is an important step for working out the size and spacing of elements, although not their final position.

Less well known than the Box Model is a process called the Visual Formatting Model. This process determines the layout and positioning of elements on the page. It encompases some concepts you might already be familiar with such as positioning schemes, formatting contexts, display modes, and stacking contexts.

Finally the page is rendered.

There might be a few terms in the paragraphs above that you are not yet familiar with. If so, what's most important is to understand that the Cascade, the Box Model, and the Visual Formatting Model are the key steps involved in interpreting, processing and rendering HTML and CSS. I've skipped over a lot of detail when describing each of these so we're now going to look at these 3 steps more closely.

Cascade

The cascade is probably one of the most misunderstood features of CSS. It refers to the process of combining different stylesheets and resolving conflicts between CSS selectors.

The cascade looks at the importance, origin, specificity, and order of declarations to determine which style rules to use.
What you need to know:
Most websites have multiple stylesheets. Typically styles are added with a link tag that references a css file, or with a style tag in the HTML body. Even the most basic page will have default styles provided by the browser. This default stylesheet is sometimes called the user-agent stylesheet.

During the cascade stylesheets are interpreted in the following order:

1. !important declarations

2. Author stylesheets

3. Browser default stylesheets

Note: I've skipped over user stylesheets here because they are not a common thing anymore and probably wouldn't factor in consideration for anyone reading this.

After combining these sources, if multiple rules apply to the same element, specificity is used to determine which rules to apply.

Specificity

Specificity is a weighting given to selectors. It's a common mistake to think of this as a single number. It's actually 4 separate numbers or 4 categories of weighting.

To calculate specificity, count the number of:

1. IDs,

2. classes, attributes and pseudo-classes,

3. elements and pseudo-elements

For example: #nav .selected:hover > a::before will be 1, 2, 2.

No number of classes will ever have a higher specificity than an ID. When comparing selectors you compare the specificity of IDs first. Only if these match do you compare the value of classes, attributes and pseudo-classes and finally, if still equal, elements and pseudo-elements.

If specificity is equal in every category, the last declaration in the source takes precedence.

Yes! I know I said 4 categories. Inlines styles have a higher specificity than IDs. Although they are technically the first category in specificity calculations you don't typically end up with competing inline styles, so it's easier just remember that inline styles will always win specificity.

Important note: !important declarations are not factored in specificity calculations but they do have a greater precedence than normal declarations in the cascade.

Inheritance

Inheritance is not part of the cascade but I've included it here because it is often discussed in conjunction with the cascade.

Inheritance is the process where values that apply to an element can be passed on (or inherited) by its children.

You are likely familiar with the fact that font properties, when applied to the body or another container element, are also inherited by every element inside that container. This is inheritance.

Not all properties are inherited by default. Understanding inheritance is key to writing more deliberate and less verbose CSS. Forcing inheritance with the inherit keyword can be incredibly useful.

Note: Some properties are such as border-color have a default value of currentcolor. This means they will use the value set on the color property. This default value is not the same thing as inheritance. Although the color property itself is often inherited so I tend to think of this as defacto kind of inheritance.

The Box Model

Understanding the Box Model is essential and necessary for limiting frustration when working with layout and positioning. It is one of the most fundamental concepts in CSS.

The box model is used to calculate the width and height of elements. It is a calculation step and not solely relied upon for determining the final layout and positioning of elements.
What you need to know:
Every element in HTML is a rectangular box. Each box has four regions defining the margin, borders, padding, and content areas of an element.

By default, when you set the width of an element, this sets the width of the content area only. When you add padding, border or margin to an element, this is added in addition to the width. In practical terms this means that two elements with a width of 50%, will not fit side-by-side if padding, margin or borders are added.

That's it! It's pretty simple right? So why is this often a source of confusion? Well, you might have encountered a few situations where things seem to behave a little differently...

Fill Area

When you set the background of an element this fills not only the content area but also the padding and border areas as well.

Conceptually we think of an HTML element as a single thing, so it's easy to think that the visual boundaries of an element are equal to its width however this is not the case. Although the visual boundaries of an element include the padding and border areas the width property is applied explicitly to the content box.

Note: Altering the box-sizing property can change this behaviour.

Width Auto

Another source of potential confusion is how width: auto works. A width of auto is the default setting for most HTML elements and for block elements such as divs and paragraphs, auto will calculate the width so that the margin, border, padding and content areas combined all fit within the available space.

In this situation it can feel like adding padding and margins push inwards on the content, but in reality, the width is being recalculated to ensure everything fits. By comparison when setting a width of 100%, the content area will fill the space available regardless of margin, padding and borders.

Box-sizing

The box-sizing property changes the way the box model works. When box-sizing is set to border-box padding and border will reduce the inner width of the content area, rather than adding to the overall width of an element. This means that a width of an element is now the same as its visual width.

A lot of people prefer this, and if you're building a grid system, or any other kind of layout that requires aligning items horizontally, this can be much more intuitive way to work.

Collapsing margins

It can be really confusing when margins collapse unexpectedly and you don't know what is going on. Margins will sometimes collapse when two or more adjacent vertical margins touch and they are not separated with padding or border. A collapsing margin can also occur if the margin of a child element extends into that of its parent and is not separated by padding.

Margins will not collapse if elements are absolutely positioned, floated, or have a different formatting context, as well as in a few other less likely situations.

If you're confused that's ok. The rules for when margins will and will not collapse are complicated. The main thing you need to know is when elements don't have padding or borders, vertical margins can collapse.

If you need more detail CSS Tricks has a wonderful explanation of collapsing margins.

The Visual Formatting Model

While the box model calculates an element's dimensions, it's the Visual Formatting Model that is responsible for determining the layout of these boxes. The Visual Formatting Model takes into account the box type, positioning scheme, relationships between elements and constraints imposed by content to determine the final position and presentation of each element on the page.
What you need to know:
The visual formatting model traverses the document tree and generates one or more boxes required to render elements according to the CSS box model. The CSS display property plays a key role in determining how an element participates in the current formatting context and positioning scheme. Together these pieces determine the final layout and positioning of elements.

This is a complex step and was by far the most difficult to try and summarise. If you don't follow everything that's ok. Understanding how we manipulate positioning schemes and formatting contexts through the CSS properties is a good start. If you can follow the interplay between different pieces of this model you are doing better than most. At very least you should know that they exist.

Display types

We know that setting the display property in CSS determines the how an element is rendered but it's not immediately clear how this works. In fact sometimes, it can even seem unpredictable.

This is because the display property determines the element's 'box type'. This hidden property consists of an inner display type, and an outer display type which together help determine how the element is rendered.

The outer display type usually resolves to either 'block' or 'inline' and is pretty much consistent what you expect of theses display properties in CSS. Technically speaking the outer display type dictates how an element participates in its parent formatting context.

The inner display type determines what formatting context that element will generate. This will impact how its child elements are laid out.

Think of how a Flexbox container works. Its outer type is block and its inner type is flex. Its children can also have an outer type of block, but their layout is influenced by the formatting context of the Flexbox container.

One way of thinking about this is that the responsibility for display is shared between an element and it's parent element.

Formatting contexts

Formatting context are all about layout. They are the rules that govern the layout of elements inside a container and how they interact with each other.

Some formatting contexts can be established directly on containers such as through the use of display values flex, grid or table. Other types such as block and inline formatting contexts are created as required by the browser.

Note: At one time, because of the way it interacts with floats, it was important to understand how to make the browser establish a new block formatting context. Elements with a block formatting context will contain floats. This is not as important today as it once was. In fact it's not even how modern clearfix techniques work.

Positioning schemes

A box can be laid out according to one of three positioning schemes. These are Normal flow, Floats and Absolute positioning. You are probably familiar with floats and absolute positioning because we interact with these more directly when writing CSS. Normal flow is just a name for the default positioning scheme when an element is not floated or positioned.

Normal flow

Normal Flow describes the default positioning scheme and 'in-flow' describes elements that conform to this. You could consider in flow to be the natural position of elements laid out according to their source order and formatting context.

Floats

Float is a CSS property that causes an element to be taken out of the normal flow and shifted to the left or right as far as possible, until it touches the edge of its containing box or another floated element. When this happens, text and inline elements will wrap around the floated elements.

Normally if not set, the height of an element will adjust to fit all of its descendant elements. When elements are floated they are taken out of flow and this means containers will not adjust their height to clear them.

It is this behaviour that allows multiple lines of text, heading and other elements to fluid wrap around floated content. But sometimes this is problematic. Clearfixes and establishing a new block formatting context will causes a container to clear its floated children. This technique has allowed floats to be used for layout which has been a corner-stone of web development techniques for a long time. It's still important to know but this is gradually being replaced with newer layout techniques such as Flexbox and Grid.

Absolute positioning

Elements with absolute positioning are removed from the flow entirely and unlike floated elements they have no impact on surrounding content.

A container with relative positioning allows you to control the offset of descendant elements using absolute positioning.

Relatively positioned elements can also be given an offset but this offset is relative to the element's normal position not another relative container.

CSS properties top, bottom, left and right are used to calculate 'box offsets'. These properties are not two dimensional offsets but allow positioning of each edge, relative to its container's content box.

Positioned elements with overlapping offsets can result in elements occupying the same space. A stacking context is used to resolve this.

Stacking contexts

Stacking context determines the order that things are rendered to the page. You can think of a stacking context like a layer. Layers on the bottom of the stack are painted first and elements higher up the stack appear on top.

Placing a z-index on an element that is absolutely or relatively positioned is the most common way to establish a new stacking context. But there are a number of other ways a stacking context can be formed including, setting opacity, transforms, filters or using the will-change property.

Some of these reasons are not intuitive and have more to do with rendering performance than developers expectations. It helps to understand that these layers can be rendered separately by the browsers. As a result it can sometimes be useful to intentionally to create a new stacking context for performance reasons.

Setting a z-index has no effect unless a stacking context is established. The higher the z-index the higher up the stack the layer is placed.

One of the most confusing parts about stacking is that a new stacking context can be established inside an existing one. This means you can have layers of layers.

In this situation, it's not always a case of the highest z-index wins.

That's it!

Almost 3000 words and I've only briefly touched some of the important hidden parts of CSS. If you've read this in full congratulations and please be sure to let me know, because you deserve some kind of reward!

If you've just read some parts that's ok too. I hope I've managed to clarify something or give a general insight into the processes involved. It's been a real challenge to explain this stuff in simple terms without sacrificing accuracy. I hope got it right.

# data[].attributes.attachment_link.description
If you use CSS in your daily work, your primary goal is probably focused around making things 'look right'. How this is achieved is often far less important than the end result. This means we care less about how CSS works than the correct syntax and visual results.

# data[].attributes.attachment_link.readable_text
Tabs or spaces? Curly brace on the same line or a new line? 80 character width or 120?

Coders love to argue about this kind of stuff. The tabs vs. spaces debate even made it into a famous episode of the HBO show Silicon Valley.
Well in this article, I will finally give you the definitive answers you seek.
Early in my career, I engaged in all kinds of holy wars. I would read some article about why a particular convention was correct, while another was totally wrong. I would get right up there on my high and mighty horse and proclaim to anyone who would listen that they were wrong and I was right.

It took me years to find the right answers but I've finally done it and it turns out the answer is...
These things don't matter.
Consistency matters. Readability matters. Arguing and stressing about one convention over another matters not.

Over the past 20+ years, I've followed every imaginable trend. I've followed the different conventions of different languages. None of it has impacted my bug count or made my code any more efficient.

Don't get me wrong, clean-looking, well-formatted code will be easier to change and maintain over time, and that's a good thing.

There's also nothing wrong with wanting your code to look beautiful. But too often, this is used to justify what essentially boils down to procrastination.

We procrastinate like this because coding is hard. Things can get complicated in a hurry and we - especially those of us who may be new to this level of complexity - can become intimidated by this complexity and grow insecure about our ability to tame it.

It's much safer to argue over trivial things. Our perceived incompetence is less likely to be exposed that way.

The phenomena of debating trivialities to avoid hard problems is so common that there are a number of popular theories that describe it.

One of the most popular is Parkinson's Law of Triviality which states that members of an organization give disproportionate weight to trivial issues.

In illustrating this law, Parkinson used the fictional example of a committee whose job it was to approve plans for a new nuclear plant, but who spent the majority of their time arguing over what materials to use for the staff bike shed. They neglected the proposed design of the plant itself, which was a far more important but also far more complex issue.

Because of the reference to a bike shed in this canonical example, Danish developer, Poul-Henning Kamp later coined the term "bike shed effect" or simply "bike shedding" to describe it.

If you work in software development - and especially if you hang out with other coders on social media - you're likely to come across some form of bike-shedding almost daily.

If you find yourself getting into an unusually heated debate with your fellow coders, online or in-person, it's probably also worth remembering Sayre's Law ...

"In any dispute the intensity of feeling is inversely proportional to the value of the issues at stake."

As a consultant, I bounce from client to client, and each one has their own rules and conventions. I decided long ago that the only way for me to succeed was to let go of the trivialities and focus on the hard problems. When it comes to coding standards, I take what I get and I don't get upset.

1. Is there tooling that will automatically apply the style rules to my code with little to no intervention from me?

2. Are the tools and underlying styles actively maintained and/or used by reputable organizations?

If you happen to find yourself in a position to pick your own style guide, I recommend that you ask yourself these two simple questions:

If you can answer "yes" to both of those questions, then you're good to go. Simple as that.
Java: Google-Java-Format Javascript Standard Style PHP Coding Standards Fixer (N.B. this is a product name, not an actual, official JavaScript standard)
Here are some options that fit the bill for some of today's more popular web languages:

If you enjoyed this article, please smash the clap icon at the bottom of this post repeatedly to help spread the word. And if you want to read more stuff like this, please sign up for my weekly Dev Mastery newsletter below.

# data[].attributes.attachment_link.title
The 100% Correct Coding Style Guide - freeCodeCamp

# data[].attributes.attachment_link.description
Coders love to argue about this kind of stuff. The tabs vs. spaces debate even made it into a famous episode of the HBO show Silicon Valley. Early in my career, I engaged in all kinds of holy wars. I...

# data[].attributes.attachment_link.description
A simple tool to build complex CSS Grid templates. CSS Grid support: [http://caniuse.com/#feat=css-grid](http://caniuse.com/#feat=css-grid)...

# data[].attributes.attachment_link.readable_text
These things called passkeys sure are making the rounds these days. They were a main attraction at W3C TPAC 2022, gained support in Safari 16, are finding their way into macOS and iOS, and are slated to be the future for password managers like 1Password. They are already supported in Android, and will soon find their way into Chrome OS and Windows in [...]

# data[].attributes.attachment_link.description
Daily articles about CSS, HTML, JavaScript, and all things related to web design and development.

# data[].attributes.attachment_link.title
Alcamy * The Internet's Catalog of Knowledge

# data[].attributes.attachment_link.description
We're an open platform for self-learners and teachers. Curating the content of the web for learning.

# data[].attributes.attachment_link.title
Tippy.js - Vanilla JS Tooltip and Popover Library

# data[].attributes.attachment_link.description
Modular JavaScript is an open effort to improve our collective understanding of writing robust, well-tested & modular applications. It consists of five books, each of which explores a key aspect of JavaScript development - comprehensively. The books are produced in the open: anyone can track their progress, report issues & contribute fixes or content.

# data[].attributes.attachment_link.description
Free vintage photos to use any way you want.

# data[].attributes.attachment_link.title
The Ultimate Guide to Font Pairing — Learn

# data[].attributes.attachment_link.description
A principle element in good graphic design comes down to font pairings. Inside, we explain the science of font pairings and how to use them to make your design in Canva look professional and sleek.

# data[].attributes.attachment_link.description
Licensing: All of our resources are free for personal and commercial use. For specific details, please review ourcopyright and terms page.Need custom work? Media Militia is a project funded byActivator Studios. We create unique and obsessively crafted designs.Hire Us

# data[].attributes.attachment_link.title
Stock Up: Instantly Search 25,000+ Free Stock Photos

# data[].attributes.attachment_link.description
Stock Up is the most popular way to search for free stock photography. We combine (with permission) the free stock photos from across 25 different websites into one simple and insanely fast search engine. New photos added weekly.

# data[].attributes.attachment_link.readable_text
In this article, Kushagra Gour introduces Web Maker, a browser extension he created for front-end developers who want a blazing-fast, offline web playground.
If you're a front-end developer like me, you've probably tried one or more of the code playgrounds out there like CodePen, JSBin, JSFiddle etc. They're all great and do the job perfectly. I've mostly used them to figure out issues I'm facing, or to discuss code snippets with colleagues. But I've always felt a slight friction in them having to work over the internet - with an inherent delay between starting them up and being able to use them.

I also wanted a quick way to hack stuff while traveling or waiting at the airport, where you're mostly offline. Of course, you can use an editor and see the results in the browser - but in this fast-paced world, that's slow to set up!

I tried looking for something that could give me what I wanted, but couldn't find any. In fact, I found many people looking for the same thing:

Wish @CodePen had an offline mode. No idea how it would work like, but still.

- Chris Armstrong (@Armstrong) February 16, 2015

So I decided to make something myself, and created Web Maker. Now I use it to do all my web experiments - and even to develop Web Maker itself!

What is Web Maker?

Web Maker is a Chrome extension that converts your new tab (optional) into a web playground where you can write HTML, CSS and JavaScript and instantly see a preview right there. It has thousands of users and is available on the Chrome Web Store.

Features

Super fast and works offline

Being a chrome extension, Web Maker lives completely in your browser. There's no network involved (unless you're using a third-party JavaScript/CSS library). So it opens instantly. Not just initial startup, but every change you make in the code produces an instant refresh in the preview. And if there's just a CSS change, it doesn't even require a refresh - it just shows up.

You also have the option to save and load your creations for later editing. They're saved in your browser's localStorage.

Web Maker is also recommended by Chris Coyier on CodePen blog, if an offline web playground is what you need:

We get asked fairly often about an offline version of CodePen. While we think that would be cool, in all honesty, we aren't particularly close to that. If you're looking for a CodePen-like offline editor, and use Chrome, check out Web Maker by Kushagra Gour.

For more on the story behind CodePen, check out the Versioning Show episode with Chris Coyier...
Preprocessors

Preprocessors are an integral part of almost every developer's toolchain. Web Maker provides you with all the most-used preprocessors out there for HTML, CSS and JavaScript - be it Markdown, Jade, SCSS, Less, JSX or TypeScript.

Adding libraries

If you need to use an external JavaScript or CSS library (like jQuery or Bootstrap) in your creation, you can simply hit the Add Library button, choose one of the popular libraries from the available list, or start typing the name of any library and select it from shown auto-suggestions.

Multiple layouts to choose from

In addition to having multiple editor layout options, each of your saved creations remembers the layout it last used, along with the code pane sizes. So, basically, whenever you load back any creation, you get the exact same editor configuration that you last saved the creation in.

Also, you get a full screen layout to see your work in actual browser window size.

Preview screenshot capture

Chrome extension APIs give Web Maker immense power to do stuff that normal web apps can't. One example is screenshot capture. Just click the Take Screenshot button anytime to take an instant screenshot of your preview.

Save as HTML or open in CodePen

When you've done your work inside Web Maker, you don't need to copy/paste it to some file to use somewhere else. You get a Save as HTML file option that embeds your HTML, CSS and JavaScript code inside an HTML file.

Or say you want to share your creation with the world: the Open on CodePen button opens your creation inside CodePen.

Open source everywhere!

I have made Web Maker open source on GitHub. I think it connects me more with the users, who can suggest features they want or log issues they face, all in one place.

There are many interesting logic pieces that go into making such a web playground. All those are open to see and learn from. I personally loved working on prevention of infinite loops using Esprima.

Web Maker heavily uses some awesome, open-source projects out there like CodeMirror, Esprima, Split.js, Escodegen, Inlet.js, Emmet etc. A big shout out to them! And as I mentioned, Web Maker also uses Web Maker. ;-)

What You Can Use Web Maker For

There are many interesting ways Web Maker can be used apart from the usual web development stuff. Let's look at some of them.

Practice while you're learning without setup hassle

If you're starting to learn web development, Web Maker is a good place to do your daily practice, assignments etc. You can focus on just writing code without getting into setting up an editor or a build process for using preprocessors.

Create independent components for you app

Component-based architecture is being widely adopted for designing web applications these days. Whether you're using React, Vue or any other JavaScript framework, everyone is heading towards making your app a collection of independent components.

You can develop and try out such independent components quickly in Web Maker - and integrate them into your app when you're happy with them.

As a Markdown editor

Web Maker isn't limited to just web development. Now-a-days, people generally write blog posts and articles in Markdown. And for that they generally use a Markdown editor. You can turn Web Maker into a markdown editor with live preview in seconds. (This article was written in Web Maker.)

Teach students in a classroom

Since Web Maker works offline, it's a great platform that can be given to students in a classroom to explore things while they learn.

Create reduced test cases for debugging

When you're trying to find the cause for an issue in your app, it's worth isolating the suspected component so that you can debug in a much smaller environment without any interference from rest of the app. Web Maker's a great tool for quickly running a piece of code like this.

Store your favorite code snippets

Found some interesting code snippet on a website? You don't have to remember or note down the URL. Simply fire up Web Maker, paste in the code snippet, give it a title and save. You can open these later for reference or editing.

Some Upcoming Features

These are some new features I'm working on:

Import/Export. Soon there'll be an option to export all your creations and they'll be importable back into Web Maker. You'll also be able to create backups to the cloud, to services like Google Drive.

Editor customization. More customization settings are on their way, including the ability to set font sizes, themes and indentation.

There's more information on the roadmap on the GitHub issues page.

Wrapping Up

So, that's an introduction to Web Maker, a browser extension I created to make life easier for front-end developers.

Because Web Maker is open-source software, you have the opportunity to mold it into something you want. You can request features, or even contribute code to get those interesting features into Web Maker.

You can also follow @webmakerApp for future updates, to suggest a feature or just to say hi if you like it!

If you've tried Web Maker and have any questions or feedback, please post a comment below.

# data[].attributes.attachment_link.title
Web Maker, an Offline, Browser-based CodePen Alternative - SitePoint

# data[].attributes.attachment_link.description
In this article, Kushagra Gour introduces Web Maker, a browser extension he created for front-end developers who want a blazing-fast, offline web playground. If you're a front-end developer like me, you've probably tried one or more of the code playgrounds out there like CodePen, JSBin, JSFiddle etc.

# data[].attributes.body
Coderbyte

# data[].attributes.attachment_link.description
Practice having thoughtful conversations about code.

# data[].attributes.attachment_link.readable_text
We help companies develop the strongest tech teams around. We help candidates sharpen their tech skills and pursue job opportunities.

Sign up Request demo

Over 40% of developers worldwide and 3,000 companies use HackerRank

It's not a pipeline problem. It's a spotlight problem.

Tech hiring needs a reset. From prepping for jobs and practicing coding to running a world-class technical interview, give developers the tools they need to showcase their skills, passion, and potential.

Explore and expand your skills.

Every idea has a first line of code. Prep for jobs and sharpen your skills alongside a global community of developers. Access the content you need to develop new skills - and land the job you've dreamed of.
Sign up and practice

Join the movement. Screen on skills.

Leave the binary tree behind.

Build coding questions using our library of dev-friendly content that challenges them to solve the problems they'd actually tackle on the job.
Start free trial

Focus on what really matters: the code.

Build skills-based coding tests with tech problems a developer would encounter on the job - and hire the team behind your next big idea.
Request a demo

Identify top contenders

Identify top contenders and invite them to meet your team using data-driven decisions that help level the playing field for developers everywhere.
Learn more

:: Technical interviews ::

Interview like it's 2024

Every company is a tech company.We're here to help 'em all.

More than 3,000 tech teams, representing all industries and from countries around the world, trust HackerRank to connect with developers and add cutting-edge skills to their teams.

That includes 25% of the Fortune 100 - and that moonshot startup that just came out of stealth.

We're discovering new ways of attracting candidates to the organization. By using HackerRank, we're actually improving the tech image of UBS.

HackerRank has actually allowed us to look for diamonds in the rough that our old process
didn't give us the time
or resources to look for.

We're promoting our jobs to a much wider audience and allowing candidates to be selected for interviews purely based on the merit of their coding abilities.

We cut down hiring time by months, which was huge for us. We owe that to HackerRank.

HackerRank is a critical piece of our candidate's experience, and hitting the right tone is just as important as identifying good candidates.

HackerRank has been a huge help in making it easy to assess the skills of all the candidates we
interview. Without it, the process of scaling our engineering team would have been very cumbersome.

# data[].attributes.attachment_link.title
HackerRank - Online Coding Tests and Technical Interviews

# data[].attributes.attachment_link.description
HackerRank is the market-leading coding test and interview solution for hiring developers. Start hiring at the pace of innovation!

# data[].attributes.attachment_link.title
Coding Games and Programming Challenges to Code Better

# data[].attributes.attachment_link.description
CodinGame is a challenge-based training platform for programmers where you can play with the hottest programming topics. Solve games, code AI bots, learn from your peers, have fun.

# data[].attributes.attachment_link.description
Are you a developer? Do you like coding?

# data[].attributes.attachment_link.title
devLearn: Coding Made Easy - Apps on Google Play

# data[].attributes.attachment_link.description
Learn real coding for the web using HTML and CSS with JavaScript coming soon.* So easy, you don't even need to know how to type.* 100% Free. No ads, no fees, and no in-app purchases.* It's fun.

# data[].attributes.attachment_link.title
Programming Hub, Learn to code - Apps on Google Play

# data[].attributes.attachment_link.description
Programming Hub is your one-stop solution to learn all the top programming courses - anywhere, anytime!Created using research, Programming Hub offers a perfect path to learn programming. You will not only acquire new skills, but also enjoy it like a game.

# data[].attributes.attachment_link.description
We're moving to our new free All-in-One app! Get it here: https://play.google.com/store/apps/details?id=com.sololearnLearn JavaScript in a greatly improved learning environment with more lessons, real practice opportunity, and community support.Have fun and learn all the fundamentals of JavaScript with SoloLearn!

# data[].attributes.attachment_link.description
The purpose of each of these tutorials is not to train you fully, but just to give you a taste. After reading them, you should have just enough knowledge to make a confident decision as to whether you would like to seriously learn these languages.

# data[].attributes.attachment_link.readable_text
We've detected that JavaScript is disabled in this browser. Please enable JavaScript or switch to a supported browser to continue using twitter.com. You can see a list of supported browsers in our Help Center.
Help Center

# data[].attributes.attachment_link.readable_text
Don’t miss what’s happening

People on Twitter are the first to know.

# data[].attributes.attachment_link.description
Day 5 Yesterday, I couldn’t finish styling the rest of the pages because I had a bad news that a good friend of mine is diagnosed with a kidney issue. So I’m continuing today. I just added the sign up & in pages. Making steady progress. #100DaysOfCode #CodeNewbie

# data[].attributes.attachment_link.readable_text
30 Day Vanilla JS Coding Challenge

Build 30 things in 30 days with 30 tutorials

No Frameworks× No Compilers× No Libraries× No Boilerplate
My Account →

Start The Challenge Today!

Sign up to get immediate access to the course dashboard

You'll get all 30 days at once so you can binge watch Netflix style.

What You'll Get

Instant Access to all 30 videos

30 days of Starter Files

Completed HTML, CSS and JS Solutions for each day

👌 Almost Done - you'll get a confirmation email any minute now.

Make it happen - commit to #JavaScript30 publicly

This isn't going to be another course you sign up for and never do.
Let's see this one through. Commit to it publicly and invite some friends to join you.

There is no formation without repetition.

So, you've done a few courses and read a few books but still don't feel great about your relationship with JavaScript.

How do you get better?

Build things. Lots of things. Build 1,000 things. Keep it up and don't stop. Seriously.

This has always been my advice. Just put in the work and you will get better.

But Wes, what should I build? I have no ideas! Please don't make me do another todo app.

Ideas, Eh? I've got lots! This is JavaScript30 - let's build 30 things together.

Who is this For?

Beginner to Intermediate developers and designers who want to become comfortable with both JavaScript fundamentals and working in the DOM without a library.

You should already know some JavaScript to start - This isn't a JavaScript 101 course. If you are new to JavaScript, or want to just get comfortable with the fundamentals, I'd recommend you take my BeginnerJavaScript.com course - use the code JAVASCRIPT30 for an extra $10 off.

We learn by application - encountering many new situations while talking about the hows, the whys and the whats that we use to solve them.

We steer clear of opinionated design patterns, frameworks, libraries and any type of abstraction. These things are great and often needed, but can obstruct learning and constrain initial understanding.

These tutorials rely heavily upon browser APIs, most of which involve interaction with the page. If you are stuck in console.log() land, these videos are your next step. Oh, the stuff we build is really fun!

Wes, How is this Free?

These videos are free as a thank-you to everyone who has supported my premium courses as well as because I believe in giving back to the community. I see a huge need for these videos and I really think it will help many of you become comfortable creating with JavaScript.

While I've spent over 300 hours on JavaScript30, enough people find they really click with my teaching style and continue their learning with one of my premium courses. It all works out!

Hey, I'm Wes Bos

Meet Wes Bos

Wes Bos is a Full Stack Developer, Speaker and Teacher from Canada. He is a course creator, works as an independent web developer and is the co-host of Syntax - a popular web development podcast. Wes has taught over 500 students in 200+ classes and spoken at dozens of conferences around the world. Wes wrote his own bio in the third person for some reason.

Wes is the author of React For Beginners, Advanced React and GraphQL, ES6 for Everyone and Learn Node which together have sold over 55,000 copies. He is also the author of JavaScript30.com, CSSGrid.io, Flexbox.io and Command Line Power User, a set of free video series. 300,000 people have taken at least one of Wes' free video courses.
Follow @wesbos

FAQ

What font / color scheme / editor / terminal is that?

I answer everything over at wesbos.com/uses. Feel free to tweet me any more questions!

I have a question, can I email you?

While I'd absolutely love to help everyone out, there are 625,599 people taking this course. I hope to get a forum setup sometime soon. If you are a member of one of my premium classes, you can jump into the #JavaScript30 room in our Slack channel.

I found another way! Could it be?!

Yes! There are probably 100 different ways to solve each of these exercises, if your answer doesn't line up with mine, it means you did a really good job at trying to figure it out yourself. My answers are by no means the best answers - just a single way of doing it. Instead of emailing me - write a blog post about how you did it. Share what you know!

I lost, deleted or never got my welcome email! What do I do?

Log into your account, or create an account with the same email you used to get the series.

Can I host a meetup / study group? Can I stream these in my classroom? Can I arrange a playing?

Yep yep yep - as long as you do not redistribute the videos you are welcome and encouraged to do this.

Can I re-distribute these and then charge money for them?

I can't believe I have to make this a FAQ. No, you silly goose.

I found a typo or errata

If it's a typo on the site, please shoot me an email here. If it's a correction in the code, you can submit those via GitHub! Please see the above FAQ if you found a better way.

You say JavaScript funny

um, I think you mean I say it the correct way! eh?

# data[].attributes.attachment_link.description
Build 30 things with vanilla JS in 30 days with 30 tutorials

# data[].attributes.attachment_link.description
Learn how Javascript works, some basic API's and finally create a mini project. - Free Course

# data[].attributes.attachment_link.description
The Collective features the latest news and resources from the web design & web development community.

# data[].attributes.attachment_link.title
Sublime Text - the sophisticated text editor for code, markup and prose

# data[].attributes.attachment_link.description
HowToUseGithub - This website will teach you how to use Github, and how to create a basic website using the HTML language

# data[].attributes.attachment_link.title
GitHub - getify/You-Dont-Know-JS: A book series on JavaScript. @YDKJS on twitter.

# data[].attributes.attachment_link.description
A book series on JavaScript. @YDKJS on twitter. Contribute to getify/You-Dont-Know-JS development by creating an account on GitHub.

# data[].attributes.attachment_link.readable_text
Web developers have spent tremendous time and effort to make reusable components. One of the problems has been CSS and its cascading nature. For example, if a developer creates a component that displays a tree structure, how can she/he ensure that CSS class (say, .leaf) used in the component will not have side-effects in other parts of the application. New methodologies and conventions have been created to tackle selector issues. BEM and SMACSS are both widely used methodologies that have served web developers well, but they are far from ideal solutions. This blog post will explain what flaws naming convention-based methodology has, what CSS Modules are, and how these modules can be used in a React application.
The problem with cascading

I am creating a reusable select list (aka drop-down list) as an example of global style issues. Styling the <select> element itself doesn't feel right because there might be a need for unstyled native element or completely different styling in other areas of the website. Instead, I use BEM syntax to define classes:

.select {} .select__item {} .select__item__icon {} .select--loading {}

If I created a new class called item without the select__ suffix, my team might be in trouble if someone else wanted to use the common name item. It will not matter whether a third-party library or a team member is creating the CSS framework for the project. Using BEM helps you avoid this problem by indicating the context select.

The BEM syntax represents a step towards components, as the "B" in BEM stands for "Block," and blocks can be thought of as light-weight components. Select is a component that has different states ( select--loading) and children ( select__item).

Unfortunately, using a naming convention and thinking in terms of components doesn't solve all the selector issues. Avoiding a name collision is still not guaranteed, and the verbosity of the naming scheme increases the risk of typos and requires a disciplined team where everyone understands the conventions 100% accurately. Typos include having single dash instead of two, mixing modifier (--) and block (__), etc.

CSS Modules to the rescue

The definition of "CSS module" is as follows:

A CSS Module is a CSS file in which all class names and animation names are scoped locally by default.

The key thing is scoped locally.

To illustrate this concept, let's create JavaScript and CSS files that will define a component.

/* select.css */ .select {} .loading {} .item {} .icon {}

/* select.js */ import styles from "./select.css"; console.log(styles.select, styles.loading);

Simple example, but there are many things happening under the hood.

The CSS file has a lot less noise than the BEM version because it doesn't contain suffixes and extra characters to repeat the context. Why is it that I could remove a suffix such as .select-- without causing problems?

The import statement in the JavaScript file loads the CSS file and converts it to an object. In the next chapter, I'll show you how to setup the build environment to support importing CSS files.

Each class name from the CSS file is a property of the object, in the example above, styles.select, styles.icon, etc.

If the property name is the class name, then what is the value of that property? It is a unique class name, and the uniqueness ensures that styles don't leak into other components. Here is an example of a hashed class name: _header__1OUvt.

You might be thinking, "That looks awful." What is the point of changing meaningful class names to cryptic code?

The main point is that such an identifier is guaranteed to be globally unique. Later in the guide, we will modify identifier creation so that it will have a more human readable identifier but still be unique.

The key benefits of having locally scoped CSS:

one step towards modular and reusable components that will not have side effects

cleaner CSS

avoidance of monolithic CSS files, as each component will have its own file

Disadvantages:

not as human-readable DOM

a bit of initial preparation to get the build step working

CSS Modules require a build step, but the good news is that various bundling tools support that step for both the client and server JavaScript source code. You can also use CSS Modules with most of the UI libraries.

To keep things simple, in this blog post I'll focus on the Webpack module bundler and React.

React, Webpack, and CSS Modules

To get started without hassle, I use the Create React App.

By following the instructions in the documentation, I get a new project up and running in no time.

npm install -g create-react-app create-react-app css-modules cd css-modules/ npm start

lo and behold, we have a React app running:

The start page says that I should edit the file App.js.

import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css'; class App extends Component { render() { return ( <div className="App"> <div className="App-header"> <img src={logo} className="App-logo" alt="logo" /> <h2>Welcome to React</h2> </div> <p className="App-intro"> To get started, edit {gfm-js-extract-pre-1} and save to reload. </p> </div> ); } } export default App;

Is the Create React App using CSS Modules? I can verify that it is by looking at the file App.js. The CSS file is being imported, but it is not assigned to any variable, and all the className definitions are using strings instead of dynamic values.

At this point, the Create React App isn't supporting CSS Modules, so I need to change the configuration to enable support.

Configure the Create React App to support CSS Modules

To access the underlying build configuration, I need to run the eject command. Note: there is no going back after you do this.

npm run eject

I can now see the config folder and webpack configuration files.

The Create React App is using webpack for all assets, so webpack.config.dev.js is the correct configuration file to modify.

I look for a section that defines what to do with the CSS files.

{ test: /\.css$/, loader: 'style!css?importLoaders=1!postcss' },

Changing it to the following will break the styling of the site for a moment because the configuration will enable CSS Modules, but the component is not changed to support CSS Modules. While I was modifying the webpack configuration, I changed the naming convention to have both human-readable part in it and the hash to keep it unique:

{ test: /\.css$/, loaders: [ 'style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]&sourceMap&-minimize' ] },

Notice that I changed loader to loaders to give the configuration section an array instead of a single string.

What are those loaders doing? The file webpack.config has a comment section that describes style and CSS loaders:

"style" loader turns CSS into JS modules that inject <style> tags.

"css" loader resolves paths in CSS and adds assets as dependencies.

The modules keyword next to the css-loader enables CSS Modules. The setting localIdentName changes the generated class name so that it contains a React component name, a class name, and, the unique hash id. This configuration change will make debugging much easier because you will be able to identify the problematic component.

Use CSS Modules in React

I can verify that the configuration works by adding a console.log statement to the import statement.

Changing import './App.css'; to

import styles from './App.css'; console.log(styles);

I get the following output to the browser console:

The classes are now unique, but they are not used in the React components. There are two steps that I have to follow to get styles applied to the React components. First, change the names of the styles to camel case. Second, change the classNames attributes so that they use imported classes.

It is not mandatory to use camel case capitalization, but, when accessing classes programmatically, it is easier to access styles.componentName than styles["component-name"].

This is the original style file:

.App { text-align: center; } .App-logo { animation: App-logo-spin infinite 20s linear; height: 80px; } .App-header { background-color: #222; height: 150px; padding: 20px; color: white; } .App-intro { font-size: large; } @keyframes App-logo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

There is no need for the App prefixes, so now is a good time to remove those as well.

.app { text-align: center; } .logo { animation: logoSpin infinite 20s linear; height: 80px; } .header { background-color: #222; height: 150px; padding: 20px; color: white; } .intro { font-size: large; } @keyframes logoSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

The second step is to change the class usage. The result looks like this:

import React, { Component } from 'react'; import logo from './logo.svg'; import styles from './App.css'; class App extends Component { render() { return ( <div className={ styles.app }> <div className={ styles.header }> <img src={logo} className={ styles.logo } alt="logo" /> <h2>Welcome to React</h2> </div> <p className={ styles.intro }> To get started, edit {gfm-js-extract-pre-2} and save to reload. </p> </div> ); } } export default App;

I have now made all the required configuration changes and changed the component so that it uses CSS Modules.

How to break CSS Module boundaries when needed

The setup described in the previous section works as a solid base for a React project, but developers tend to soon realize that they need a way to share styles. In this context, "sharing" means explicitly indicating that a component should inherit something from the base styles.

Shared information can be variables (colors, font sizes, etc.), helpers (SASS mixins), or utility classes.

CSS Modules have an extend functionality that can be used across files with the from keyword.

In the following example, I have two files: one for button base styles and one for the submit button implementation. I can tell that the class submitButton should be composed of base button styles.

/* base_button.css */ .baseButton { border: 2px solid darkgray; background-color: gray; } /* submit_button.css */ .submitButton { composes: baseButton from "./base_button.css"; background-color: blue; }

The previous example was about CSS classes. If variables are necessary, then you can either use a preprocessor like SASS or Less or add variable support to your webpack.

The example in the variable support documentation:

/* variables.css */ @value blue: #0c77f8; @value red: #ff0000; @value green: #aaf200; /* demo.css */ /* import your colors... */ @value colors: "./variables.css"; @value blue, red, green from colors; .button { color: blue; display: inline-block; }

I would make a tiny change to the variable naming: use SASS syntax for variable names that are preceded by a dollar sign. The reason for this change is that overriding standard values like blue makes the CSS file less understandable because you can never be sure whether the value has been overridden.

Changed example:

/* variables.css */ @value $blue: #0c77f8; @value $red: #ff0000; @value $green: #aaf200; /* demo.css */ /* import your colors... */ @value colors: "./variables.css"; @value $blue, $red, $green from colors; .button { color: $blue; display: inline-block; }

Conclusion

In this guide, I started with the problem with global CSS and explained why CSS Modules improve the situation by introducing scoped CSS and pushing us towards component-based thinking. Also, I went through the way to easily start experimenting with CSS Modules using the React Starter Kit.

If CSS Modules are used in the backend build step, browser support is not an issue. Browsers receive regular CSS from the server, so there is no way to negatively affect user experience with CSS Modules. Instead, we improve user experience by decreasing the risk of broken layout. The webpack with loaders configured to accept CSS Modules hasn't caused any issues, so I would give it a thumbs up without hesitation.

If you have tried CSS Modules, I would like to hear your experiences!
Discuss on Hacker News

# data[].attributes.attachment_link.title
Practical Guide to React and CSS Modules

# data[].attributes.attachment_link.description
Web developers have spent tremendous time and effort to make reusable components. One of the problems has been CSS and its cascading nature. For example, if a developer creates a component that displays a tree structure, how can she/he ensure that CSS class (say, .leaf) used in the component

# data[].attributes.attachment_link.description
Amazing video tutorials that turn beginners into professional software engineers.

# data[].attributes.attachment_link.description
Learn the technical skills to get the job you want. Join over 50 million people choosing Codecademy to start a new career (or advance in their current one).

# data[].attributes.attachment_link.description
Firecode.io is an online coding interview preparation platform with over 500 problems and answers that will help you crack the coding interview.

# data[].attributes.attachment_link.title
Learn to code with free online courses, programming projects, and interview preparation for developer jobs.

# data[].attributes.attachment_link.description
Learn to code with free online courses, programming projects, and interview preparation for developer jobs.

# data[].attributes.attachment_link.readable_text
There are only two hard things in Computer Science: cache invalidation and naming things.
- Phil Karlton

CSSRooster is here to alleviate programmers from the second one - naming things, more specifically, writing class names to HTML tags.

How does it work? CSSRooster takes your HTML code as input, including CSS styles, and then writes class names for your HTML tags by analyzing the patterns hidden in your code. Since you would not want to leak any class names in your HTML code (otherwise, CSSRooster can just cheat, although in fact he will just ignore it), there are two ways for you to associate styles: Method 1, just inline all styles. Method 2, use some random characters as class names that would not leak any information of the underlying DOM element. An example below (note that only webkit based browsers are supported for running the examples):

Just like how every new parents name their beloved babies, they need to know if they are boys or girls, are they naughty or quiet, so and so. The same goes with CSSRooster, who has access to all the visual and semantic properties of a DOM element. It learned the top 1000 sites on the Internet on how they give class names to various elements. With this knowledge he can make some really informative guesses. Click on the "ASSIGN CLASSES" button above if you haven't and see the class names wrote by CSSRooster.

We can see that CSSRooster successfully learned to give class names such as title, list, item, icon, etc. It knows that an item usually don't go alone, and usually has a list parent. It also knows a common pattern in the front end engineer's toolbox, use an <i> as an icon within a link.

Another thing worth noting is how CSSRooster gives the class button to a link but gives link to the others. The following is the rendered result of the the code above.

As you can see, CSSRooster successfully learns to recognize the first <a> element as a button and the ones below as links. We human beings definitely know when an <a> element is a button and when it is a link. CSSRooster does this in a similar way, you can try to slice out some of the CSS properties such as border to make the button look more like a link. And at some point, CSSRooster will notice that this is not a button anymore and possibly assign link to the element. You might want to ask, what are the properties that CSSRooster thinks make a button, well, the answer is I don't know, it's all learned from the data, so whatever the data says :)

The following example is a signup form of Ebates.

The rendered version:

One thing very interesting about this example is the the "Join with Facebook" and "Join with Google" "button"s. The author of Ebates, they actually put icon on these two "button"s, which kind of makes sense since they are actually just two images - the old fake button trick people use before CSS3 support becomes prevalent, But they actually act as buttons, and the model correctly recognizes that, by leveraging knowledge learned from other web page authors!

This Rooster is still very young though. From the example above, we see that it recognizes the <label><input> pattern in HTML forms by correctly assigning label class to the <label> element. But it fails to guess what the text input is. There might be several reasons. For one, data noise, which is a common culprit for a lot of real world deep learning problems. For example, for class names, different authors might have different preferences, some of them call a button as button where others might call btn. Even for the same button, one might set its background as black, the other might set it as red, one might have box shadow, the other might have no shadow at all. So the biggest challenge of the model is how to find an average out of all these different types of front end engineers who are from very different cultures. The same goes with HTML forms, which is very tightly bound to the specific business of the website, so the pattern there is even weaker and CSSRooster doesn't know what to do with it. Another possible reason is due to unbalanced training data. If you do a quick mind search, you would notice that you mostly only see 2-3 text/password fields per landing page, whereas much more text/boxes and the mostly invisible divs. This issue is solvable by using a more advanced sampling technique though, which is one of the future work of CSSRooster.

What's CSSRooster's role in Huula? It's going to be a part of Huula intelligent designer (try it out here). With CSSRooster, we can automatically apply conventional styles to an undesigned/lightly designed web page and get it ready for launch or further tweaks. It will also make it easier for users to select similar elements and style them all at once. Since the data Huula receives already contains all the styles, but the class name might be very badly designed, so it's not easy to perform something like 'select all menu items'. But with CSSRooster, we can just feed the site data to the model and have the page 'normalized', then the page will have all the menu items categorized together for your selection.

Now, it's your turn! Play with it with your HTML code and let us know your thoughts on twitter @huulaofficial.

As some folks are asking the model details. I'll briefly explain it here. CSSRooster's brain consists of an embedding layer for class names, a convolution layer (with max pooling) and an LSTM layer and projection layer. A very conventional model. It was trained for about 3 days on a Core i7 MacBook Pro (yeah, I know, the fan screams quite a bit, but our GTX GPU is on the way!).

Side note: why is this thing called CSSRooster? Coz it's 2017 - Fire Rooster Year!

Presented by Huu.la - UI design + AI.

01/30/2017

# data[].attributes.attachment_link.title
CSSRooster - A Bot that Writes CSS Classes for HTML with Deep Learning

# data[].attributes.attachment_link.description
There are only two hard things in Computer Science: cache invalidation and naming things. - Phil Karlton CSSRooster is here to alleviate programmers from the second one - naming things, more specifically, writing class names to HTML tags. How does it work?

# data[].attributes.attachment_link.entities[].name
Quincy Interviews Devs Software Engineer

# data[].attributes.attachment_link.entities[].name
Quincy Interviews Devs Comparison Operators & If Else

# data[].attributes.attachment_link.title
Clean Code: Variables - Beau teaches JavaScript

# data[].attributes.attachment_link.description
Learn how to write clean code in JavaScript! Create variables that are readable, reusable, and refactorable. The video is based on an article from Ryan McDermott. Original article: 🔗 https://github.com/ryanmcdermott/clean-code-javascript Code: 🔗 http://codepen.io/beaucarnes/pen/EZVmjv?editors=0010 Beau Carnes on Twitter: https://twitter.com/carnesbeau - We're busy people who learn to code, then practice by building projects for nonprofits.

# data[].attributes.attachment_link.description
We've been talking about writing less complex JavaScript. We do this by choosing the right abstraction to solve a problem. But how do you know which abstraction to use? So far, we haven't looked at any concrete examples of how to do this.