Smashing Podcast Episode 3 With Jina Anne: What Are Design Tokens?

Smashing Podcast Episode 3 With Jina Anne: What Are Design Tokens?

Smashing Podcast Episode 3 With Jina Anne: What Are Design Tokens?

Drew McLellan

Jina Anne In this episode of the Smashing Podcast, we’re talking about Design Tokens. What are they, what problem do they solve, and how can they be used within an existing Design System? Drew McLellan talks to someone who is much more than a token expert: Jina Anne.

Show Notes

Transcript

Drew: She’s a design systems advocate and coach. While at Amazon, she was senior design systems lead and she was lead designer on the Lightning Design System at Salesforce, while at Apple she led the CSS architecture and style guide for the Apple Online Store. She’s worked with GitHub, Engine Yard, and the Memphis Brooks Museum of Art and more. She founded and organizes Clarity, the first design systems conference, and is on the Sass core team where she leads the brand design and website for Sass. When it comes to design systems, you’d be hard pushed to find anyone more qualified, but did you know that she’s never seen a sidewalk? My smashing friends, please welcome Jina Anne. Hello, Jina.

Jina Anne: Hello.

Drew: How are you?

Jina Anne: I’m smashing.

Drew: I wanted to talk to you today about design tokens, which I think is a phrase many of us have probably heard passed about, but we perhaps aren’t sure what it means. But before we get to that, I guess we should talk a little bit about design systems. I mean, design systems are your thing, right?

Jina Anne: Yeah. It rules everything around me. Yeah.

Drew: I think that there’s something that we’re seeing is becoming increasingly common in projects and people are making them public and seems to be a real movement around design systems. But I think there are plenty of organizations that don’t have them in place still. What problem does a formalized design system solve from your point of view?

Jina Anne: It can solve many problems. I think some of the more common problems that people seek to solve is around maintainability and consistency. That usually has to do with design debt or in some cases code debt, some cases both. I also look at it as a… Like, it’s not just about the code or the design, but also the problems around how people work together. So, I look at it as a way to also solve some of the issues around communication and workflow process and so on.

Drew: Are design systems then something exclusively that are useful to really big teams and big organizations?

Jina Anne: I don’t think so. I’ve seen them work really well with smaller teams or sometimes even with a lone designer. They definitely help with larger teams for sure, but they are definitely not exclusive to large teams. In fact, I think if you see yourself perhaps growing at some point to be a large team, then having the system in place already will help you do that more efficiently.

Drew: What did you think are the sort of symptoms that somebody might be looking for if they’re working and they’re still having problems? What do those problems look like that might be solved by putting a design system in place?

Jina Anne: There’s a few, duplication of efforts, duplication of code. You might have a breakdown in communication where things just aren’t being built the way they’re expected to be built. It could come down to things that aren’t documented well, so people don’t really quite know what the best thing is to use or where to look. Yeah, there are all sorts of signs.

Drew: I guess design systems are generally a concept, rather than a specific technical solution. In your work, you must see people using all sorts of different tools to achieve design systems.

Jina Anne: Yeah.

Drew: What are some of the more common ways that people actually go about it?

Jina Anne: I think the most common ways are having a component library done in code and often cases you’ll see it in it like a React library or an Angular library, whatever, platform you’re using. There’s usually also a website associated with it that will display those components. Then you’ll usually see perhaps like a Sketch or a Figma library as well.

Jina Anne: But one of the things that I like to stress to people is that if you look at that website that displays your documentation and your components, that website is not actually your design system. It’s a representation of your design system. So, I think a lot of people spend a lot of time on making this gorgeous, beautiful website and it’s fine. They’re nice to look at and they’re nice to share and they help a lot with communicating what you’re doing and even with recruiting.

Jina Anne: But it’s the system itself that it represents that I want people to spend their love and care into, so thinking through what’s going into that website, like the content and how you’ve organized things, how you’ve named things, the things that you’re systemizing, so, yeah. I think a lot of people think about the artifacts, like the deliverables, but really it’s a lot more than that. It’s a lot of process and workflow as well.

Drew: Is it exclusively web projects that the design system would help with?

Jina Anne: Not at all. It is the most common, I believe, from, at least, what I’ve seen, but design systems definitely can cover many things. In the digital space, you have native platforms, but even outside the digital space, I think a lot of people talk about design systems in a digital product space. But they’ve been around for ages for traditional medias and real-world scenarios. If you have seen the NASA graphic standards manual from like the ‘70s, that was a design system. It just was across all the different like rockets and spacesuits and all that, instead of digital products.

Drew: So, I guess, there must be some overlap between things, traditional things like brand guidelines and that sort of documentation that I think probably people are familiar with in all sorts of walks of life. There must be a crossover between that sort of documentation of a system and a more modern concept of a design system.

Jina Anne: Yeah, I believe so. I think a lot of people forget that it’s all about branding. The whole reason any of this even started and why we want to display these things in a uniform or unified way is all about the brand because brand isn’t just logos. It’s how people use and experience your company’s service or product or whatever it is that you offer. So, yeah, absolutely.

Drew: So, I’ve got a design system in place, I mean an organization. We’ve done a whole lot of work. We’ve got a design system. There are creatives within the organization working in maybe, like you mentioned, Figma or Sketch. We’ve got web designers using that in a CSS. Perhaps we’ve got a mobile team doing like Android and iOS development, building apps. Loads of people working with a design system contributing into it and consuming stuff from it. Where do design tokens come in? What problem do they solve?

Jina Anne: Ooh, yes. Let me first take it back to a story. When I first joined at Salesforce, I was actually part of a small project team. It was a different product, it’s like a productivity tool like tasks and notes and things like that. We were only three designers and I was the only one that, I guess, I wouldn’t say brave enough, but maybe interested enough to work with the Android designs. The other two designers, I think, just weren’t quite as interested. So, I was basically the main designer on our Android app. Then I also did a lot of design for iOS app and, of course, the web application as well and the marketing website, so lots of different projects in play.

Jina Anne: With the website, since I like to design and code, it was pretty straightforward. I could go ahead and build the buttons and typography and everything that we needed for the web application or the marketing website, document it in code and deliver that.

Jina Anne: However, with both the Android and iOS app, I don’t really know how to code for that and so I wasn’t able to deliver the same thing. So, I was having to do a ton of redlines specs, which, if you’re not familiar with redlines, it’s essentially where you are specking out every single spacing, font size, color, anything to indicate how to build it for the engineer. I would do these for many, many, many screens and, of course, a lot of those screens had variations because maybe you’re showing what happens when you clicked that button or when a certain state happens. So, doing this across many, many screens and then saving those up to Dropbox and then documenting it in a Wiki. That was the process that I was having to do at the time.

Jina Anne: I usually think about things in a CSS way, like especially the C in CSS, so I usually think, “Oh, well, font sizes should only need to be declared one time because it’s going to cascade everywhere.” But I found that with certain engineers that I’ve worked within the past, if you don’t spec it, and I guess with native it works a little differently, they’re not going to build it and so I would have to be very explicit and name pretty much everything per screen. I was just like, “Oh, why is it like this?” Then any time we made any changes, I had to go back through and change all those screens again. It was not fun at all.

Jina Anne: Fast forward to when I moved over to the core team of Salesforce, I had been working in the Sass website and I’ve been playing around with using a YAML file to store the data for colors, typography, spacing and so on and was looping over that data to create the style guide, as well as the Sass variables in the classes. The reason I did that was we open-sourced the Sass website and I wanted people to be able to contribute to the design as well. But I didn’t want to make it a tedious process where you had to update the style guide along with any colors that you’re adding and so doing it this way, just kind of automated that process.

Jina Anne: I showed that to the team at Salesforce and then that kind of is where the concept of design tokens spawned off of. So they built a tool called Theo and there’s other tools out now that do the same thing like Style Dictionary. But the idea of it is you have this automated tool that takes the data that you give it and generates the code. You might think, “Well, that might be over-engineering variables. Why not just use variables?”

Jina Anne: Well, the idea is, as you alluded to earlier, like native platforms just take those attributes in a totally different way and so trying to scale design to Android and iOS, whatever other platforms that get Salesforce. We had some people on Java, we had some people on React yet, some people on Angular, PHP, not just internally at Salesforce, but also externally with all our partners and customers that were building their own applications. So, this was a way to store our visual information as data and then, in an automated way, generate the variables or the XML data you needed or the JSON data, whatever format that particular platform looked for.

Jina Anne: Then what was great about it was we found, let’s say a color doesn’t pass contrast ratios. I didn’t have to then notify the Android team and the iOS team and the web team. I just made that change and then they would get that change automatically the next time that they would pull in the latest. So, it just really helped streamline a lot of that and helped us be able to take off some of the burdens of updating visual designs from the engineers and that let us do that.

Drew: So, instead of being sort of variables within one particular code base, within your own React codebase or within your PHP or within your Java or wherever, they’re like variables across an entire organization? Is that fair to say?

Jina Anne: Correct. Correct. Then what’s cool is things like colors, for example, like transparent colors, you do that differently in Android, like eight-digit hex, instead of RGBA like you would with web. So that tool that you use, if you’re using one that is built to think through all this, does that transformation for you. So, rather than saying RGBA 50 comma, 40 comma, whatever the color, you can just say color background card or something like that. It’s really more of a named entity now and then you can all be speaking the same language, even though it might render a different syntax.

Drew: Right. So, although variables kind of the nuts and bolts of how it might be implemented, the idea is kind of much bigger than just what you’d think of as just variables. I mean, I guess in a way like RSS could be called just variables. But, actually, the way it enables us to distribute blog content and podcasts and everything has a much wider impact than just the core technology that’s there.

Jina Anne: Yeah, I think that’s actually a really good metaphor. I do see a lot of people when they use it or talk about it in their own design system website, they’re usually only talking about like Sass variables or CSS variables. I think that’s why there’s this confusion, like, “Well, isn’t that just variables?” It’s, like, “Why are we renaming it?” But it is that much broader application of it with a whole process around it. It even gets into like how you distribute those variables across components, like on a global level or on an individual component level. You can have multi-layers and so on. It can get pretty interesting.

Drew: So, I suppose as well as helping in the maintenance, you mentioned being able to change a color in one central location and then have everything that is, using those design tokens, be able to pick it up when the next build or next refresh from the system, presumably this has the potential to enable all sorts of other interesting things. I know a lot of people make sort of white-labeled products. It’s the same core product, but it’s customized with different design tweaks for different and things. So, using design tokens could actually be a solution for those sorts of applications as well, the need to span more than just one particular codebase.

Jina Anne: Right. Yeah. So, that was definitely a use case at Salesforce. We have a lot of, I don’t know why I’m still using present tense, but we had a lot of customers that wanted to be able to brand their UI that they were using. So, we had this concept of certain variables that we wanted to actually be seen more as like a constant, like maybe it’s an error color versus colors that were meant to be configured, like brandable colors. So, for some people’s needs that can get interesting, too, white labeling or offering any sort of theming, dark mode or night mode, even offering a feature, which you may have seen in Gmail, but it’s like that comfortable, cozy, compact spacing density. So, there are all sorts of extra stuff that you can get with it across multiple products very quickly, which is really nice.

Drew: It is really an extension of core principles of programming where you make sure that you’ve really defined things once in one place, so you don’t have multiple instances so it’s easy to update. But it is looking at that as a much, much bigger idea than just one small element of a product, looking at it across everything and centralizing that.

Jina Anne: Yeah, so we definitely looked at these as our source of truth. However, in case anybody is worried about like, “Well, Android does things differently than iOS,” or you might have some concerns there. Depending on how you’ve architected things, you can still solve for those use cases. So, we would have a global token set that all our products would basically import in, but then we made them in a way where you could either alter it for that particular context or extend it, like offer maybe additional tokens that only that particular context needs. So, you can still give the fine-tune experience that you need to give to each of those context, while bringing in the most common shared things.

Drew: On a technical level, how would this actually work? Is there like a common file format the different systems share? Is there like an established standard for how you declare your design tokens?

Jina Anne: It’s interesting that you asked that. There’s actually a community group formed through… W3C has all these community groups. It’s not really exactly a working group, but it’s still like an initiative across various people that are in this space trying to come up with a recommendation of what those standards could be. Even how people store their data can change. Like it could be YAML, it could be JSON, it could even be a spreadsheet. Then what you export would be different because you might be using Sass, you might be using LESS, you might be using some sort of XML base system. We actually don’t want to tell you which of those things to use because depending on our use case, you might need to use spreadsheets instead of JSON or YAML or you might need to use XML instead of Sass or LESS or even CSS variables. That’s because everybody’s products are so different and have different needs.

Jina Anne: But what we can standardize on is around the tooling to generate these things. The reason we want to try to come to some sort of standard is because so many design tools are starting to implement this, InVision, Adobe, Figma. All these tools are looking at design tokens because there is a need to not just make this a code-based thing, but make this a design tool-driven thing as well. We don’t want to do it in a way where those tools don’t feel like they can innovate. We want them to be able to innovate, but at least offer some sort of standards so that new tool-makers can get into this space and already have sort of an established understanding of how to set that up. So, while we’re not going to get strict on your format of what file format you’re using or what tool you’re using, we’re going to more try to standardize on like the internal process and basically the API of it.

Drew: Because like I said, once that API has been defined, the tooling can spring up around it that speaks with that API for whatever tools that people want to use. So, somebody could write up a Java library that speaks that API, and then anything that’s using Java could make use of it and so on. Are there any tools currently that support design tokens in any way?

Jina Anne: Yeah. On the code side, I mentioned already Theo and Style Dictionary. There’s also one called Diez, D-I-E-Z. That’s kind of newer to the space and it’s taking it beyond, just like doing the transformation process, but kind of treating design tokens as a component in a way and so that’s cool.

Jina Anne: Then on the design side, InVision already has it in their DSM tool, which is their Design System Manager tool. The last I looked at it, it was just colors and typography, but I do know when I… I talked to Evan, who is one of the main folks behind that product. He did tell me other things like spacing should be coming into play, if it’s not already. I haven’t looked at it super recently. I know there are newer tools that are really catching my eye, like modules and interplay. Both of those are code-driven design tools.

Jina Anne: Then I’ve been told that it’s supposed to come into some of the stuff that Figma and Adobe are doing, so I’m not sure if I’m revealing secrets. I don’t think I am. I think it’s all stuff they’ve talked about publicly. But, yeah, I’m really excited because I think while it was something that we were doing really just making our design system work easier, it’s kind of almost accidentally created a path for bringing design tools and code cluster together. That’s really exciting to me.

Drew: The makers of these various tools, are they working with the design tokens community group?

Jina Anne: Yeah, a lot of them have joined. Since I’m a chair member, I get to see by email, everybody who joins. It sends me a notice. What’s cool is not only just seeing all these design tool people joining, but also seeing big companies. I saw like Google and Salesforce and all that, so it’s really exciting. Because I think it shows that this really matters to where a lot of people are doing on a large scale and small scale and that’s pretty cool.

Drew: So, if I was sort of listening to this and thinking about my own projects, thinking, “Ah, yes, design tokens are absolutely the answer to all these problems that I’m having,” where would I go to find out more to start learning and start maybe using design tokens?

Jina Anne: It’s a really good question. There are a few articles and I can send you some links to include with this, but I think one of the first articles, which I wish I had written, but Nathan Curtis wrote and that he actually kind of helped bring attention to them. I think he inspired a lot of people to start using them, so he kind of discusses what they are and how to use them, his recommended way.

Jina Anne: I don’t like the title of this next article I’m going to mention, but it’s called Design Tokens for Dummies. I’m not a fan of using that terminology, but it is a pretty well thought-through article that goes to pretty much everything about them. There was a CSS Tricks article by Robin Randall recently that just explains really what they are. I did a All You Can Learn Library session for Jared Spool a while back, but it is a membership-based thing so you would have to have access to that to see it. I know there’s been a lot of presentations and stuff, but there’s not like an official book to it yet. But that’s perhaps something I’m working on. It’s like one of two books I’m working on, actually.

Drew: So, if I’m a toolmaker or I work for maybe a big organization that’s having these sorts of problems and they’ve got some ideas about maybe contributing to the process of designing how the standard works, is the design tokens community group something that I could get involved in?

Jina Anne: Absolutely. I think you’ll want a GitHub because that’s where all of the public discussions and notes and things are happening. Then on the W3C community group website, you can create an account there. Having that account enables you to join other community groups as well. But then, yeah, at that point once you’ve created your account there and… I think it asks if you have any affiliations, like if you work for a big company or anything like that, just so it’s transparent, like if you have any, I wouldn’t say necessarily bias, but like a certain interest. It just helps everybody understand where you’re coming from. Anyway, at that point, yeah, you join and you’re pretty much in.

Drew: It’s quite an open process then.

Jina Anne: Yeah.

Drew: What’s in the future for design tokens? What’s coming down the line?

Jina Anne: I’m really excited about what’s going on with the community group. Kaelig’s been doing most of the leading of it. He’s the co-chair with me and I really love seeing his passion behind this. My particular interests in this are really around the education of it. So, kind of similarly to the work I’ve been doing with the Sass community, I kind of want to do a little bit of that for the design token community, like talk through how to educate people on what this is and not just make it an API doc, but also like where to get started, how to get into this. That’s something I’m interested in project-wise.

Jina Anne: I’m also really keen to see where this evolves, especially with all these design tool companies getting involved. Then a lot of people mostly think about design tokens as a visual abstraction, but really what it came from was the same technology that you used for localizing content. You wrap things in strings and then you can pass through different stuff, so bringing it back to its roots. I’d love to see the application of this apply in different ways, like interactions and content. I’m not really super keen on AR/VR-type stuff, but how does it maybe manifest there? Yeah, really just seeing it kind of go beyond just like the visual layer of what we see.

Drew: I guess that’s the beauty of having an open process like the W3C community group, is that people who do have specialisms in things like AR and VR can contribute to the conversation and bring their expertise to it as well.

Jina Anne: Absolutely.

Drew: I’ve been learning a lot about design tokens today. What have you been learning about lately?

Jina Anne: I’m always trying to learn something, but I’ve actually been occasionally taking some cocktail classes. Yeah. I’m not really with the interest of becoming a bartender, but more of just having an appreciation for cocktails. What’s cool about these classes is they’re beyond just making cocktails. They actually talk about business practices and ethical practices, the hygiene of your bar, all sorts of stuff like that, so it’s been really fascinating because I think I have like this weird fantasy of one-day leaving tech and maybe going into that. Let’s see.

Drew: Do you have a favorite cocktail?

Jina Anne: Manhattan.

Drew: It’s good. It’s good.

Jina Anne: Yeah.

Drew: You can’t go wrong with a Manhattan.

Jina Anne: I have been ordering a lot of Old Fashioneds lately so that would probably be number two.

Drew: Do you have a favorite bourbon?

Jina Anne: Ooh. The first one that came to mind is Angel’s Envy. It’s like finished in port barrels that have kind of this slightly port-like essence to it. Their rye is really good, too. It’s like finished in rum barrels, so it almost has like a banana bread-like flavor to it.

Drew: This is a direction I wasn’t expecting to go in today.

Jina Anne: Yeah.

Drew: Was there anything else you’d like to talk about design tokens?

Jina Anne: My take is, just like with design systems, people are going to use them in different ways and also there might be people out there that don’t even need to use this. If you just have like an editorial website that is pretty straightforward, maybe all you really need are CSS variables and that’s it. There’s no need to over-engineer things.

Jina Anne: This is really more for people that really need to scale or if you have a theming context then maybe. But, yeah, it’s really not meant for everyone. So, just because it’s becoming kind of a hot thing to talk about, you might not need to even bother with it.

Drew: If you, dear listener, would like to hear more from Jina, you can follow her on Twitter where she’s @Jina, or find her and all her projects on the web at sushiandrobots.com. Thanks for joining us today, Jina. Do you have any parting words?

Jina Anne: Design systems are for people.

Smashing Editorial (dm, ra, il)

Populating a web page table from a SQL query

I need help on a new problem. On my womens golf club web site I have a Members Directory page which consists of a table, 5 columns in width, and enough 2 rows sets to hold the members photo in the odd numbered rows with the members name in the even numbered rows. Visually it looks like;

table1.jpg

We currently have around 53 members which means the table contains 22 individual rows (11 sets of 2 rows). The directory is sorted by last name, so when ever a new member joins a laborious cut and paste process takes place to get the new member into her proper sorted position. If the new members last name is Williams its not to bad but if her name is Connor its a lot of work.

So I have written the following code to automate the process which generates an up-to-date sorted Members Directory page each time it is visited.

if($dbSuccess)
  {
$activeMembers_SQLselect = 'SELECT CONCAT(FirstName," ",LastName) AS name, Picture ';
$activeMembers_SQLselect .= 'FROM ';
$activeMembers_SQLselect .= 'members ';
$activeMembers_SQLselect .= 'WHERE Status = "Active" ';
$activeMembers_SQLselect .= 'ORDER BY LastName , FirstName';

$activeMembers_SQLselect_Query = mysqli_query($dbConnected,$activeMembers_SQLselect);   

$records = mysqli_num_rows($activeMembers_SQLselect_Query);
$set = 2;                               //  Number of rows to display picture and name
$tblColumns = 5;                        //  Numbr of columns in output table
$s = 0;                                 //  Set counter
$r = 0;                                 //  Row counter
$c = 0;                                 //  Column counter
$sets = Round(($records/$tblColumns)+0.5);      // 1 set is 2 rows odd rows are pictures, even rowes are names  

echo    'Record Count = '.$records;         //  Temp record count
echo    ' 2 row sets = '.$sets;             //  Temp set count

echo    '<hr>';
        $row = mysqli_fetch_array($activeMembers_SQLselect_Query); 
echo    '<table width=700px align=center>';
            For ($s = 1; $s <= $sets; $s++)
              {
                For ($r = 1; $r <= $set; $r++)
              {
echo            '<tr>';
                For ($c = 1; $c <= $tblColumns; $c++)
                {
                  If ($r&1)     // If $r is Odd
                 {
                  $currentPic = $row['Picture'];
echo         '<td width=60px align=left><img width=100 src="../MemberPhotos/'.$currentPic.'"</td>';
                  }
                else            //  $r is Even
                  {
                    $currentName = $row['name'];
echo            '<td width=240px align=left><strong>'.$currentName.'</strong></td>';
                  }
              }                 //  For $c
echo            '</tr>';
          }                     //  For $r
        }                       //  For $s
echo    '</table>'; 
echo  '<hr>';

The above code does output a table with 5 columns and 11 sets of 2 rows as it should...HOWEVER, it's the first record's picture and name throughout. I am not moving through the records. Please help.

Gutenberg 6.9 Introduces Image Titles, Block Patterns, and New Theme Features

On November 13, the Gutenberg team launched version 6.9 with several features, most of which were aimed at developers. Users can now add custom image title attributes. Plugin developers can start diving into the new Block Patterns API. Plus, theme authors can begin tinkering with the experimental gradient presets and block templates features.

Gutenberg 6.9 fixed numerous bugs, including an annoying invalid content error when selecting a color for the pullquote block. The update included several enhancements and changes to the underlying codebase.

Much of the work in version 6.9 went toward experimental features, including the navigation block. At this point, the nav block still needs a ton of work for practical use. The interface is still a bit clunky. Undoubtedly, this is one of the toughest user experience challenges to solve and will take time before it is ready for widespread usage. Right now, it is about continually iterating upon the work from previous versions.

Image Title Attribute Field

Screenshot of using an image title in the Gutenberg block editor.
Editing the image title field in Gutenberg.

The ability to add image titles is perhaps the biggest user-facing feature added in Gutenberg 6.9. The original ticket for adding the feature has been simmering for over a year.

The Gutenberg team added the title field under the “Advanced” tab when editing an image block. This was a smart decision because image titles are often used incorrectly to describe an image, which is the job of the “Alt Text” field located under the “Image Settings” tab. Image titles are also generally unnecessary. When used, they should describe the role of the image on the page.

Initial Block Patterns API Merged

Screenshot of selecting a column layout in the Gutenberg block editor.
Choosing a column layout in the block editor.

The Block Patterns API is a developer feature primarily for creating initial setup states for complex blocks. For example, the columns block has several common patterns that users may want to choose. By providing those patterns when first inserting a block, the user does not have to go through the routine of configuring all of the settings for it.

The idea is to cut back on the complexities of configuring some blocks so that users can more quickly get to the point of adding their custom content and getting their desired results.

The first step toward the Block Patterns API was merged into Gutenberg 6.9, but it is still in the experimental stage at this point.

Block Gradient Presets

Screenshot of setting a button block gradient background in Gutenberg.
Adding a gradient background to a button in Gutenberg.

Gutenberg introduced gradient backgrounds in version 6.7 for the button block. The feature launched with a set of gradients that did not match users’ themes, which meant the feature was little more than a fun experiment.

In version 6.9, developers can register custom gradients that are less of an eyesore by using colors that fit into the theme’s color palette.

Currently, block gradient presets are marked as an experimental feature and use the __experimental-editor-gradient-presets theme support flag. Now is a good time for theme authors to begin exploring this feature so they can be ready when the experimental flag is removed.

Block Templates for Themes

For theme authors, block templates were the most exciting aspect of Gutenberg’s potential when it first launched. Throughout all of WordPress’ history, creating custom page templates, particularly front page templates, has been an exercise in frustration. Theme authors have always had great ideas about what their themes’ front pages should look like. In a way, it is an author’s signature on a theme project. It is often what sets one theme apart from another.

However, creating an interface that allows users to change what is traditionally a blog post list to something more ornate and complex is not an easy thing to do. Hundreds, perhaps thousands, of varying implementations are currently in the wild, each with their take on how to create a custom front page.

Enter Gutenberg. Theme authors, regardless of whether they love or hate it, usually see the potential of a block-based editor in terms of laying out a front page. The idea of having complete control over where specific blocks sit and how they appear on the front end is an alluring one, especially if there is a standardized experience for users to figure out how to plug their content into the blocks.

Gutenberg 6.9 laid the groundwork toward this reality by resolving block templates from a theme’s /block-templates folder.

At this point, theme block templates are still in the experimental stage as part of the full site editing feature. From a theme development perspective, this could be revolutionary.

Best Free Website Builders

Building a website has never been easier.

The days of developers and web designers being the only people who can create a website are long behind us. Anyone can create a website in minutes without writing a single line of code. All you need to do is find a website building platform.

But if you’re creating a website for the first time, you’re probably looking for the most cost-effective solution. You might want to test out different options to see what you like the best.

If this sounds like your situation, then I’m sure you’re looking for a free website builder.

Dozens and dozens of platforms out there will tell you that you can build a website for free. Unfortunately, building a legitimate website for free is actually not very realistic.

Most free website builders will be extremely limited or have some contingencies that require you to pay. It might start out as free, but you’ll quickly learn that it’s not truly free.

This shouldn’t discourage you from trying different website builders. Free website building plans are a great way to get your feet wet with web creation. A free plan will also help you pick a platform that you ultimately want to pay for down the road.

In this guide, I’ll show you the best free website builders on the market today. I’ll explain what you actually get for free, and what features require a premium membership.

The Top 12 Free Website Builders

All website builders offer free features. You’ll be able to get a free trial with nearly every website builder on the market today. But these 12 website builders have free plans that go beyond a trial period:

WordPress

wordpress

34% of the entire Internet is powered by WordPress. It’s the most popular CMS in the world and a top choice for building a website.

With WordPress, you can create a website and get it live on the web without paying anything. Free plans include hosting, themes, and a WordPress.com subdomain.

Don’t expect high-level performance from the free hosting plan. The WordPress subdomain won’t be very professional either.

We use WordPress here at Quick Sprout, but we have a premium plan. If we stuck with the free option, our domain would look like this: www.quicksprout.wordpress.com, which is obviously no good.

You do not need a credit card to create a free WordPress site. So you won’t have to worry about an expiring trial or being charged for hidden fees.

The free WordPress plan is best for getting started with something small, like a personal blog. It comes with Jetpack essential features, which has SEO tools and automation functionality. You’ll get a pre-installed SSL certificate, free templates, and 3 GB of storage.

It’s worth noting that WordPress is not a traditional website builder. You should have a basic understanding of writing HTML code and how it works to use WordPress.

When you’re ready to upgrade to a paid version of WordPress, these are your options:

  • Personal — $4 per month
  • Premium — $8 per month
  • Business — $25 per month
  • Ecommerce — $45 per month

WordPress users rely on plugins to add features and functionality to their sites. Many of these plugins require payment as well, which will add to your costs.

Wix

wix

Wix lets you create a website for free without writing any code. It has a drag-and-drop editor that makes it easy for anyone to build something beautiful, regardless of their technical experience.

All you need to do is choose a template and customize it with your own content.

Here’s what you get with a free Wix plan:

  • Hundreds of templates
  • Stock images, icons, and clip art
  • Free web hosting
  • SEO assistance
  • Mobile optimization
  • Access to free apps in the Wix App Market
  • 500 MB of storage and 1 GB of bandwidth
  • Free Wix domain

The free Wix domain is even weirder than the WordPress one. It’s yourwixusername.wixsite.com/yoursiteaddress; which would look like this for us here at Quick Sprout — quicksproutadmin.wixsite.com/quicksprout.

Obviously, this type of domain is not reasonable or realistic to use if you’re serious about creating a legitimate website. But it’s fine for the beginning while you’re evaluating the Wix platform.

The free plan will also have Wix ads appear on every page of your website.

Using Wix for free will give you an introduction to their platform, but you’ll quickly learn that it’s very limited if you’re not paying. You’ll take an action or try to do something and be prompted to upgrade your plan, which can be a bit annoying.

Wix has premium plans starting at $13 per month for blogs, portfolios, and personal sites. Business and ecommerce rates start at $23 per month.

Weebly

weebly

Weebly is powered by Square, making it a website builder that’s geared toward ecommerce websites. So for those of you who are looking to create an online store from scratch, Weebly would be a top choice to consider.

Unfortunately, the free Weebly plan doesn’t come with any ecommerce functionality. You’ll need to upgrade for selling capabilities.

Here’s what you get with Weebly for free:

  • SSL certificate
  • 500 MB of storage
  • Free hosting
  • Domain name with Weebly branding
  • SEO tools
  • Lead capture and contact forms
  • Access to community forums
  • Live chat and email support

Compared to other free plans we’ve seen, this one is actually pretty good. It’s still extremely limited and I wouldn’t recommend it for the long-term, but it’s a viable option for starting out.

You can begin to collect customer information before your online store officially launches.

For $5 per month, you can connect your own domain to eliminate the Weebly branding. Aside from that, Weebly has premium plans starting at $12, $25, and $38 per month.

Webnode

webnode

Webnode is website building made easy. In minutes, you can create and publish your site on the web. It’s a great option for personal sites, businesses, and ecommerce shops.

More than 30 million people have built a website using this platform. Webnode has stunning templates that you can easily customize with your own content.

Unlike other free website builders, you can create an unlimited number of pages with the free plan from Webnode.

You’ll also get reliable hosting and access to customer service representatives.

The biggest catch is that your site will have a Webnode subdomain with your free plan. But this is pretty much the industry standard if you’re not willing to pay.

I’d only use the free plan for something simple like a blog. You can create your site, publish content, and then share your work on social media. But once you’re ready to take things to the next level, you’ll need to consider one of the following paid plans:

  • Limited — $3.95 per month
  • Mini — $5.95 per month
  • Standard — $11.95 per month
  • Prof — $19.95 per month

Webnode does require an annual subscription with all plans. So this won’t be the best choice for those of you who prefer month-to-month contracts.

Ucraft

ucraft

Ucraft is a bit unique compared to some of the other platforms we’ve seen so far. It’s advertised as a landing page creator, as opposed to a website builder.

The free plan can be used to create simple single-page websites.

If you already have a domain name, you can connect it for free. This means your free site won’t be forced to use a ucraft.net subdomain, which is a big bonus since most free website builders won’t give you this luxury. However, your website will have Ucrafted branding on the page itself.

Here are some of the other features and benefits you’ll get for free with Ucraft:

  • SSL certificate
  • Drag and drop builder
  • Visibility settings
  • SEO tools
  • Google analytics
  • 24/7 support
  • Password protected pages
  • Free hosting
  • Unlimited bandwidth

For a free plan, this is actually pretty good. Again, the only catch is that you’ll be limited to building just one page. To create more than that, you’ll need to upgrade to one of the following paid plans:

  • Pro — $10 per month
  • Pro Shop — $21 per month
  • BigCommerce — $39 per month

All premium plans come with a 14-day free trial. No credit card required.

Onepager

onepager

Onepager is a website builder marketed toward small business owners. It’s intended for people without much technical ability who want to create a site with ease.

Onepager offers a “free forever” plan, which is extremely limited. Here’s a quick overview of what you get (and don’t get) for free:

  • Onepager branded domain
  • No web analytics
  • No email
  • Onepager ads on your pages
  • No ecommerce capability
  • No custom forms
  • No custom CSS

You’ll still get hosting and 24/7 support, but overall, I wouldn’t recommend the free site for any serious websites. Use this plan if you’re interested in trying Onepager as an extended trial.

To remove Onepager ads, use your custom domain, and activate ecommerce functionality, paid plans start at $8 per month with an annual contract.

Cindr

cindr

Building a website with Cindr is about as easy as it gets. They eliminated lots of the complex features and distractions for users who prefer simplicity.

You’ll be able to quickly add and publish photos, videos, music, text, and other content on your site in minutes. Designs are mobile-friendly and highly responsive.

You can create a site with Cindr without providing any credit card information. In fact, Cindr has just two plans; Free and Premium.

The free plan comes with:

  • Custom design capability
  • MyCindr.com domain
  • Live chat and email support
  • Unlimited pages
  • Free hosting
  • 1 GB of bandwidth
  • Unlimited storage

Your free Cindr site will have Cindr ads displayed on your pages. To remove those ads, connect your own domain, and build multiple sites, you’ll need to upgrade your plan.

The Premium plan is $9 per month with no long term contracts. It also comes with unlimited bandwidth and storage.

Site123

site123

Similar to our previous review, Site123 also has just two plans; Free and Premium. Compared to other website builders, the free plan is actually packed with quality features.

You’ll get everything included with the Premium plan, except you won’t be able to use your own custom domain. You’ll also be limited to just 500 MB of storage and 1 GB of bandwidth.

Aside from that, here are some of the features that come standard for free with Site123:

  • Intuitive page editor
  • Mobile-friendly designs
  • Free hosting
  • SEO tools
  • 24/7 support

This website builder is a bit different from a traditional drag-and-drop editor. But it’s still easy to use and doesn’t require any code.

To get the most out of your Site123 website, upgrade to a Premium plan starting at $12.80 per month. This comes with ecommerce capabilities.

Strikingly

strikingly

Millions of users have used Strikingly to create a website. It stands out from the other platforms on our list because it has ecommerce capability built-in, including the free version.

That’s right. For free, you can build an online store with Strikingly.

There’s just one catch. You can only have one product on display per website.

However, Strikingly lets you create an unlimited number of websites with the free plan. This is definitely better than some of the other options we’ve seen that restrict you to just one website or limited pages.

The free plan from Strikingly also offers 5 GB of bandwidth, which is more than we’ve seen from its competition.

As expected, you’ll be stuck with a Strikingly subdomain if you sign up for the free plan. To use your own domain and benefit from premium features, these are your upgrade options:

  • Limited — $8 per month
  • Pro — $16 per month
  • VIP — $49 per month

These prices are based on annual contracts. To save money, Strikingly offers long-term contracts for up to five years. All premium plans come with a 14-day free trial.

Webstarts

webstarts

Webstarts is another popular free website builder. It’s reliable, versatile, and extremely easy to use.

You can create a website with an unlimited number of pages, but Webstarts pretty limited beyond that.

The free plan doesn’t allow you to use a custom domain. There’s no social integration, emails, SEO tools, contact forms, or slideshows either.

Your free Webstarts site won’t be mobile-friendly and won’t give you HTML access or ecommerce capabilities. All free sites will have ads on every page.

Overall, you can’t really build a legitimate site unless you upgrade to a premium plan. There are two paid options, priced at $7.16 and $19.99 per month, respectively.

Yola

yola

With Yola, you can create and publish a website online in less than 30 minutes. Unlike other free website builders, Yola won’t put ads on your pages, although you will have a Yola domain.

Yola’s drag-and-drop site builder is simple and easy to use. It doesn’t require any technical experience, making it a top choice for beginners.

With that said, advanced users can edit using HTML, JavaScript, and CSS.

The Yola free plan has 1 GB of bandwidth and 1 GB of storage. You’ll also benefit from features like:

  • SEO tools
  • Email support
  • Web hosting with 99.9% uptime
  • Social sharing
  • Ability to embed YouTube videos
  • Google Maps integration
  • Video backgrounds
  • Contact forms
  • Tumblr blog integration
  • Site statistics

However, there is one major contingency here. You can only build three web pages.

Obviously, that’s not reasonable for those of you who want to create a full website. The three pages are only enough to test out Yola’s platform to see if you like it enough to upgrade to:

  • Bronze — $4.95 per month
  • Silver — $9.95 per month
  • Gold — $19.95 per month

All of these plans come with a 30-day money-back guarantee. You can add ecommerce capabilities to any premium plan for an extra $10 per month.

Jimdo

jimdo

Jimdo was born back in 2007. Since then, more than 20 million websites have been built using this platform.

You can build a website for free using Jimdo, although your options will be extremely limited.

All free websites will have a .jimdosite.com subdomain. You’ll get 500 MB of storage, 2 GB of bandwidth, and HTTPS security. That’s pretty much it.

Jimdo will only let you build five web pages with the free plan. That’s obviously not enough to build a full website. But you’ll still be able to get your site live and see if you like the software before you upgrade.

I’d treat this free website builder as a trial that never expires. If you’re happy with the platform, then you can upgrade to one of the following paid plans:

  • Start — $9 per month
  • Grow — $15 per month
  • Grow Business — $19 per month
  • Grow Legal — $20 per month
  • Unlimited — $39 per month

To get the most out of Jimdo, the Unlimited plan will be your best bet. It doesn’t have any restrictions and gives you better access to customer support. Jimdo also has ecommerce plans starting at $15 per month.

Hidden Costs of Free Website Builders

Lots of website builders say they are free, but they fail to mention any hidden costs. In reality, the majority of website builders are not truly free if you want to create and publish a legitimate website. These are some of the top hidden costs you need to keep an eye out for.

Custom Domain

Every free website builder on the market will give you a free branded domain with their name somewhere in the URL. But if you’re serious about publishing your site on the web, you’ll need to buy your own domain name.

There are a couple of site builders that let you connect your custom domain with a free plan, but you’ll still be paying for that elsewhere.

I do not recommend buying a domain from your website builder. Check out my list of the best domain registrars for more guidance with this process.

Web Hosting

Most free website builders will also offer free web hosting. But to be blunt—free web hosting stinks.

If you plan to have site visitors at any point after your site goes live, you’ll definitely need to take web hosting more seriously. Don’t worry, web hosting isn’t that expensive. These are my top recommendations for the best cheap web hosting plans.

Page Limitations

There are plenty of website builders out there that let you build a site for free with an unlimited number of pages. Some will even let you create an unlimited number of sites with a free plan.

However, there are other free website builders that restrict how many pages you can create before you’re forced to upgrade.

These page limitations can be as low as one or three pages. Obviously, you can’t build a full website with those types of restrictions. Adding pages will cost you money.

How to Choose the Best Website Builder For You

With so many free website builders on the market, choosing just one can be difficult. Here is the process that you should use when narrowing down the best option for your website.

Upgrades

If you want to start with a free website builder for now, that’s fine. But eventually, you’ll need to upgrade. You can’t really make a legitimate and high-quality website for free.

So choose a website builder that has plenty of upgrade options to meet your needs.

You don’t want to switch to a different platform when you’re ready to start paying. That’s too much of a hassle, and you’ll probably need to rebuild the majority of your site.

Ease of Use

You shouldn’t be struggling to create a website. Look for platforms with drag-and-drop builders and lots of templates that you can easily customize.

If you don’t have a technical background, this will make your life much easier.

Basic functions like adding text, images, videos, and creating new pages shouldn’t require too much effort. Managing your site, publishing blog posts, and everything else must be simple.

Some website builders, like WordPress, are extremely popular. However, WordPress doesn’t have a traditional drag-and-drop builder. So if you don’t have certain technical skills, avoid website builders that require coding knowledge.

Type of Website

What kind of website are you building?

Blogs, portfolios, ecommerce shops, and small business websites are all very different. You have to make sure that the website builder you choose has the ability to accommodate your needs.

Just because a website builder makes it easy for you to publish blog posts, it doesn’t mean it’s a great option for your online store. If you refer to the list above, you’ll see that some builders are definitely made for creating certain types of websites.

Conclusion

Creating a website for free is easy. All of the website builders on our list allow you to create a website for free.

But with that said, even the best free website builders are limited in some capacity. Some of these platforms will have more restrictions than others.

If you’re serious about creating a website, I would not recommend building it for free.

Instead, use these free builders to try different options. Think of these as extended free trials that won’t expire. Once you find a platform that you like, take a look at their paid options and upgrade to a suitable plan that meets your needs.

The Communal Cycle of Sharing

What I'm interested in this year is how we're continuing to expand on tools, services, and shared side projects to collectively guide where we take the web next, and the way we're sharing that.

So many other mediums—mostly analog ones—have been around for ages and have a deeper history. In the grand scheme of things, the web, and thus the job of building for it, are still pretty new. We talk about open source and licenses, the ebbs and flows of changes of web-related (public and for-profit) education, the never-ending conversation about what job titles we think web builders should have, tooling, and so much more. The communal experience of this field is what makes and keeps this all very interesting.

The sharing aspect is equally, if not more important, than the building itself.

I thoroughly enjoy seeing browsers share more of their new builds include. I'm grateful that we have multiple browsers to work with and not one monolithic giant. I'm obsessed that websites like CodePen and Glitch exist and that sharing is the main goal of those services, and that people's lives have changed because of an experiment they created or came across. I'm touched that people make things for their own needs and feel inclined to share that code or that design process with someone else. I'm also glad to see design tools focus on collaboration and version control to improve our process.

Recently, I was thinking about how delightful it was to set up Netlify to host my site and also use it for client work at thoughtbot. I used to try to understand how to set up staging previews based on pull requests or scratch my head as I tried to understand why the "s" in "https" was so important. But now Netlify helps with those things so much that it's almost like that side of their service was built for people like me.

But, it gets better. In a community Slack, a fellow web builder says "Hey, Netlify's a great tool and my static site generator now works on it."

So then here I am at midnight and wide awake, starting a new demo repository using 11ty.

Fast forward, and another fellow builder shares their project Hylia, which makes starting an 11ty site on Netlify delightfully easy.

And all of this is freely available to use.

Putting this all together, I realize we're moving from a place where we're not just sharing what we have, we're working to build and improve on what others have built. And then sharing that, and the cycle continues. In a way, we've been doing this all along but it feels more noticeable now. In a way, we're not just building websites, but building and iterating the way we build websites, and that is exciting.


The post The Communal Cycle of Sharing appeared first on CSS-Tricks.

Squarespace vs. WordPress

Creating a new website from scratch is exciting. But where do you start?

The first step is choosing a website builder. If you do some preliminary research, you’ll quickly learn that Squarespace and WordPress are two of the top options to consider.

With that said, Squarespace and WordPress are very different.

Squarespace is a traditional website builder with some of the highest quality design templates that you’ll find on the market. It has a drag-and-drop builder, which means you don’t need to know how to code if you’re using Squarespace.

Squarespace is more of an all-in-one platform. You’ll be able to get your domain and web hosting plan from this provider as well.

On the other hand, WordPress is not technically a website builder, but you can still use it to create your own website. WordPress is a CMS (content management) system that powers 34% of the entire Internet. We use WordPress here at Quick Sprout.

WordPress requires a bit more technical knowledge and basic coding ability. The upside of using WordPress is that offers complete customization—it’s virtually limitless.

In short, anyone can create a beautifully designed website with Squarespace, but the functionality of the site will be limited. WordPress allows you to scale and customize your website with total freedom, but it requires more work and technical ability.

There are definitely pros and cons to each of these website builders. I created this guide to help you determine the best option for your website.

I’ve identified 12 evaluation categories that you should keep in mind when you’re looking for the best website builder. I’ll highlight the strengths and weaknesses of each platform and ultimately choose a winner for each category.

Simplicity and Ease of Use

To evaluate the ease of use, I considered how you set up an account and get your website started from scratch. I reviewed the building features as well as editing and managing your website down the road.

Squarespace Ease of Use

You don’t need to have any coding skills to use Squarespace. The drag-and-drop website builder and editing tools make it easy for anyone to create a website from scratch.

To get started, you simply choose a template and start customizing the page elements to your liking. You can even edit your website from your mobile device with the Squarespace app.

Squarespace

The best part about using Squarespace to build your website is that you can see what your changes look like in real-time. You’re dragging, adding, and moving things around directly on the page.

It’s easy to add a text box or image and simply drag it exactly to where you want it on the screen.

Although I don’t recommend it, you can also get your domain and hosting directly from Squarespace as well. These offers are great for people who want to manage everything in one place from the same provider.

WordPress Ease of Use

Getting started with WordPress requires a bit more work. You’re responsible for your own domain and hosting, which is what I would recommend regardless of the platform you choose.

But unlike Squarespace, your WordPress site gets built in the backend using code. You won’t see what these changes look like in real-time. You’ll essentially be making changes in the dark and then previewing them when you’re done to see how things turned out.

WordPress users will rely on plugins and coding skills to customize their websites.

WordPress does offer a builder-like tool called the Gutenburg editor, which allows you to add blocks for page elements like images, text, or headers.

gutenburg

However, this is not nearly as user-friendly and design-savvy as the drag-and-drop builder offered by Squarespace.

But for those of you with coding skills, WordPress will be a breeze. Plus, it’s the easiest way for you to have ultimate control over every single aspect of your website.

Best Website Builder For Beginners: Squarespace

In terms of simplicity and ease of use, Squarespace is the winner.

If you’re a developer or having coding experience, you’ll find WordPress very easy to use as well. But the average person with no technical knowledge will be lost using WordPress for the first time.

Professional Design

Website visitors will judge the credibility and trustworthiness of your website based on its design. Your design has a major impact on user experience, engagement, and conversions.

That’s why it’s crucial that you find a website builder that allows you to create an attractive and functional design.

Squarespace Design

Squarespace is best-known for the quality and professionalism of their templates and designs. If you have a creative vision for your website, Squarespace will let you turn that vision into a reality.

They offer templates that are clean and modern—perfect for building a website in this day and age.

squarespace templates

Finding a template for your website is easy. Just browse the list of categories to see choices for your niche.

Photographers, fashion designers, musicians, artists, and anyone with a portfolio should consider Squarespace to showcase their work. But it’s also a top option for small businesses and entrepreneurs.

Squarespace offers award-winning designs that are highly customizable and optimized for mobile devices. It’s easy for you to switch your template at any time.

WordPress Design

WordPress has thousands of both free and paid themes for you to choose from.

wordpress themes

To find the best WordPress theme for your website, simply browse by category and determine your budget. As you can imagine, higher quality themes will cost you more money.

Since it’s an open source platform, anyone can add a theme to WordPress. While this gives you more options to choose from, it also means that some of the themes are not as responsive and reliable. So you need to make sure that you choose a theme that will support your site without weighing it down or causing problems.

Not every theme offered on WordPress will be optimized for mobile devices. Avoid any themes that aren’t mobile-friendly.

The upside of using WordPress for design is that you can completely customize your theme using code and plugins. Although switching themes isn’t always the smoothest transition, especially if you’ve made lots of complex changes to your site.

Best Website Builder For Design: Squarespace

While Squarespace has fewer themes than WordPress, the quality of the designs are far superior. All of the themes are all beautiful, mobile responsive, and highly customizable.

Squarespace is still a bit restricted in terms of how much you can change compared to WordPress. But this category was no contest from the beginning—Squarespace is the clear winner.

Built-in Features and Tools

This category focuses on “out of the box” features offered by each platform. This will give you an idea of your capabilities and limits without having to rely on any third-party tools.

Squarespace Features

Squarespace comes with tons of built-in features. It has virtually everything you need to build a new website from scratch. Some of the top features include:

  • Free Google Fonts
  • Video Backgrounds
  • CDN (content delivery network) included
  • Point of sale tools
  • Email campaigns
  • Marketing tools
  • Ecommerce tools
  • Blogging tools
  • User data collection tools

The list goes on and on. You can check out the full Squarespace feature index here.

I like Squarespace because you don’t need to install any third-party plugins or apps to build, edit, and manage your site. Everything can be controlled directly from your admin dashboard.

Whenever Squarespace comes out with a new tool or feature, it will automatically be available for you to use.

WordPress Features

One of the reasons why WordPress is so powerful is because you can install a plugin for virtually anything and everything that you could possibly imagine. The problem is that those plugins don’t come standard when you create a WordPress account.

With that said, there are still some basic features that are built-in to WordPress.

Most of these features are related to publishing. WordPress has tools for things like scheduling content and editing images. You’ll also be able to add passwords to pages and manage your comments.

WordPress has features for multiple contributors and multilingual settings as well.

You are responsible for updating your WordPress version (we’ll talk about this in greater detail later). So any new features and tools won’t be immediately available if you aren’t updating your WordPress account.

Website Builder with the Best Features: Squarespace

Everything you need with Squarespace comes standard out of the box. The features are more robust and easier to access than WordPress.

While WordPress has the capability to do more overall, those tools and features aren’t built-in.

Plugins, Apps, Extensions, and Add-ons

Now let’s evaluate the tools and features that can be installed or added on to these website builders. Add-ons can offer more flexibility and customization when you’re creating your site.

Squarespace Apps

Squarespace does not have an app store or way to add building and customization capability to your website. All of its tools are already built-in to the platform, and they’re updated automatically.

With that said, you can integrate certain apps and tools with your Squarespace account.

squarespace apps

But overall, you’ll be relying heavily on the built-in features when it comes to building and editing your website. The integration with third-party apps won’t really change that.

WordPress Plugins

As an open source platform, anyone can create a tool and add it to WordPress. Programmers and designers can offer these tools for free or charge other WordPress users to install them.

This is where WordPress shines. There are roughly 55,000 plugins available for you to download and install to your WordPress site.

Wordpress plugins

The capabilities here are endless. There is a plugin for nearly anything you can possibly imagine. This gives you the opportunity to add custom functionality to your website.

Just be careful before you install a plugin to your site. Remember, anyone can create these.

I only recommend adding plugins offered by legitimate developers. So don’t slack when it comes to due diligence for evaluating a potential plugin.

To learn more about WordPress plugins and their capabilities, check out my guide on the best WordPress plugins for each essential category. This will give you a better understanding of the possibilities for your website.

Website Builder with the Best Add-ons: WordPress

All of the Squarespace apps are built-in, so the platform never really had a chance at winning this category. The sheer volume of available plugins that you can add to your WordPress site is unlike any other website builder on the market.

Plugins are the reason why people love WordPress so much. It’s the best way to truly customize your website exactly the way you want to by adding specific functions.

SEO Friendly

In order for your website to be successful, it needs to be visible and rank high in SERPs. You should definitely look for a website builder that has tools and features that focus on SEO.

Squarespace SEO

Squarespace has SEO best practices built-in to its platform. It has automatic sitemaps, auto redirects, canonical tags, robots.txt files, and plenty of other ways to boost your site’s SEO.

The nice part about using Squarespace is that you won’t have to go out and install any apps to deliver these SEO capabilities. You won’t have to think twice about your website being SEO-friendly because Squarespace handles everything for you.

WordPress SEO

WordPress is fully optimized for SEO on the backend. You can make changes to nearly every aspect of your website to make your content more appealing to search engines.

Modifying permalinks, creating a sitemap, header tags, meta descriptions, and robots.txt are all areas where WordPress excels. WordPress is the ultimate website builder for the technical side of SEO.

Plus, you can always add on plugins to improve your SEO strategy even further.

Yoast SEO has more than five million active installations. It gives you complete customization and control over your WordPress site from an SEO perspective.

Best Website Builder for SEO: WordPress

Squarespace is an SEO-friendly website builder, but it’s no match for WordPress. The flexibility of WordPress and the ability to add SEO plugins will give you an advantage when it comes to ranking organically in search engines.

Blogging Capability

All websites should have a blog. But there’s a difference between a blogging website and website that features a blog as a supporting element. I’ve taken both of these scenarios into consideration when evaluating Squarespace and WordPress for blogging.

Squarespace Blogging

Squarespace offers basic blogging capabilities. You can choose the layout and appearance of your blog while allowing multiple contributors as well.

You can tag your blogs, segment them into categories, and edit them at any time. Squarespace also lets you set up automatic posting on social media any time you publish a new blog.

The best part about using Squarespace for blogging is that you’ll get stylish templates for free.

But you won’t have the ability to access the HTML code of your blog, which is a problem if you really want to customize your content.

Overall, the Squarespace blogging tools are suitable for niche websites that also have a blog. For example, if you’re a photographer and use Squarespace to showcase your portfolio, you can add a basic blog as well.

WordPress Blogging

WordPress is built for bloggers. We publish hundreds of blogs per year here at Quick Sprout, and that’s one of the many reasons why we trust WordPress as our website builder and CMS.

Unlike Squarespace, WordPress lets you access the HTML code of your blog. You may not need to take advantage of this often, but at least it’s available when you need to.

WordPress is by far the most popular blogging platform on the market.

woocommerce

As you can see, Squarespace owns just a fraction of this market share.

Another benefit of using WordPress for your blog is the ability for you to manage comments. You have complete control over who can comment on your blog. WordPress also offers plenty of plugins to customize and improve the blog on your website.

Best Website Builder For Blogging: WordPress

If blogging is the primary feature of your website, WordPress is definitely your best bet. Squarespace offers a basic blogging platform, but the fact that you can’t access the HTML code of your content is a huge downside.

Ecommerce Functionality

Are you planning to sell products or services online? You need to find a website builder that makes this as easy as possible for you.

Squarespace Ecommerce

Modern layouts and simple designs make Squarespace a frontrunner for selling online. You can easily build an ecommerce shop using Squarespace since ecommerce functionality is built-in to the platform.

squarespace ecommerce

Squarespace makes it easy for you to sell products, services, subscriptions, and digital content. You can also sync your online inventory with your physical store locations to improve in-person selling.

You’ll also benefit from features like built-in tax tools, gift cards, discount codes, and flexible checkout pages. This is everything you need to optimize your ecommerce shop for conversions.

Squarespace offers easy ecommerce integrations with platforms like PayPal, FedEx, UPS, Stripe, Apple Pay, USPS, and many more.

WordPress Ecommerce

WordPress is not optimized for ecommerce out of the box. You’ll need to install a plugin for ecommerce functionality.

There are tons of options to choose from, but WooCommerce is the most popular and it’s what I would recommend.

woocommerce

Once you install WooCommerce to your WordPress site, selling online is simple. You’ll have the ability to completely customize your store, instead of relying on cookie-cutter designs and templates.

It’s possible to add any function to your ecommerce site with WordPress. You can work with a developer or programmer to create these functionalities for you if you can’t find a plugin that meets your needs.

With WooCommerce (and other plugins), it will take you a bit longer to build a store from scratch. Updates to the plugin and your WordPress version aren’t always smooth.

Best Website Builder For Ecommerce: Squarespace

Squarespace is the winner for ecommerce because the capabilities are already built-in to the platform. You can start selling products and services with Squarespace out of the box with no hurdles in the setup process.

WordPress ultimately offers better flexibility and customization for your ecommerce store, but it’s reliant on plugins.

If you already have a WordPress site, then installing WooCommerce is a no-brainer. But if you’re building a new ecommerce store from scratch, you’ll be better off with Squarespace.

Maintenance and Updates

When evaluating the best website builders, you need to look beyond the initial creation process. It’s important to choose a platform that makes it easy for you to manage, maintain, and update your content for the lifetime of your website.

Squarespace Maintenance

Ongoing maintenance with Squarespace is about as easy as it gets. There is nothing that needs to be done on your end.

Squarespace regularly tests updates and automatically applies them to your website. In most instances, you won’t even know that anything has happened. This allows you to spend your time focusing on more important tasks related to owning and operating a website.

WordPress Maintenance

WordPress is constantly coming out with new updates. They do this in order to improve the security and performance of the platform. Failing to update your WordPress version can put your site at risk for malware and attacks.

In addition to updating WordPress, you also need to keep up with updates for all of your plugins. Sometimes plugins aren’t updated as frequently as they should be, which can cause compatibility issues with your WordPress version.

You can take advantage of automatic updates, but it still requires you to stay on top of everything.

Best Website Builder For Maintenance: Squarespace

Squarespace maintenance is hassle-free. They handle all of the updates for you, which is a big edge over WordPress.

Keeping up with WordPress updates can be a pain, but it’s really not that difficult. Just don’t ignore them because you can put your website at risk for problems related to security and performance.

Security

Unfortunately, security needs to be a top concern for every website. There are too many bad people out there that target websites with malware, spam, and hacks in an attempt to steal information related from to business, customers, and website visitors.

Every website is at risk, no matter what platform you’re using to create and manage your site. But some platforms offer more advanced security capabilities and features than others.

Squarespace Security

Squarespace includes an SSL certificate with your plan. They handle all of the security for you.

Since Squarespace is a popular website builder, hackers will occasionally target it. But overall, it’s not as big of a target as more popular platforms.

WordPress Security

With WordPress, the security of your site is completely in your control. This has its pros and cons.

On the one hand, you can take steps to set up your website to be a fortress. But on the other hand, if you do nothing, your site will be susceptible to attacks.

The benefit of using WordPress is that you can install security plugins, like Wordfence, to handle all of this for you as well.

wordfence

If you’re using WordPress, check out my list of the best WordPress security plugins to see some alternative options.

But since WordPress is the world’s most popular CMS, it’s also the most attacked platform by hackers and cybercriminals.

Best Website Builder For Security: Squarespace

This was a tough one, but Squarespace is more secure compared to WordPress. Squarespace sites aren’t as vulnerable to attacks and the Squarespace team handles everything for you. The fact that an SSL certificate comes standard with your plan is a bonus as well.

WordPress is still secure if you know how to set up everything properly. But it’s not the safest option out of the box.

Retaining Rights to Your Content

Content ownership might not be the first thing you think of when you’re creating a website. But you should always review the policies of whatever platform you’re using to publish content on the web.

Without realizing it, you may inadvertently lose the rights to work that you thought was your own.

Squarespace Content Ownership

Anything you publish on Squarespace is your content. If you decide to move to another platform, you can take all of it with you.

However, the templates are licensed to you; they aren’t actually owned. So even if you paid for a template, you won’t be able to keep it if you leave Squarespace.

Here are a couple of excerpts from the Squarespace terms of service page that are worth reviewing in greater detail.

Squarespace terms of service

In short, everything on your website is being licensed to Squarespace. This means that they can modify, store, publish, and reproduce your work.

Under this agreement, they also have the right to use your website as an example for marketing and promotion of their platform.

Some of you might be turned off by this, but I wouldn’t worry too much about it. Big companies like Squarespace will always try to keep their customers happy. It doesn’t benefit them to steal your content outright. This terms of service agreement is pretty standard if you compare it to social media networks like Facebook, Instagram, or Twitter.

WordPress Content Ownership

WordPress is a free and open source platform. All of the source code on WordPress is free for anyone to distribute, modify, and use as their own.

That’s what makes WordPress so great. It’s perfect for adapting and customizing functions to your specific needs.

Since WordPress is set up this way, all of your content is 100% yours. WordPress does not impose licensing terms similar to Squarespace. This means you have total control and ownership of your content with no strings attached.

Keep in mind, WordPress users are responsible for their own web hosting. So your web hosting provider might include content ownership terms that are similar to Squarespace.

Best Website Builder For Owning Content: WordPress

WordPress has better terms than Squarespace when it comes to owning content. If you use WordPress, then you don’t have any licensing contingencies in your terms of service.

You won’t be able to keep your site themes or templates, regardless of which platform you use.

Site Migrations

In a perfect world, you’ll build your website on a platform and stick with it forever. But for one reason or another, you may decide to migrate your site to a new platform.

Maybe you want to move from WordPress to Squarespace. Or maybe you’re trying to migrate for Squarespace to WordPress. You could potentially migrate your site to a different platform altogether.

Website builders don’t always make it easy on you when you’re leaving. So this evaluation category primarily focuses on exporting your site during a migration.

Squarespace Migrations

Migrating your site from Squarespace to another platform can be tricky. Squarespace limits what you’re able to move and retain during a migration.

You’ll be able to migrate all of the basics like your pages, blog, comments, galleries, image blocks, and text blocks. But beyond that, you’ll have to rebuild quite a bit on the new platform when the migration is complete.

Squarespace offers step-by-step instructions to guide you through the migration process, which is definitely helpful.

The complexity of your migration will depend on the type of website you have. For example, it will be easier to migrate a Squarespace blog than a Squarespace ecommerce store.

WordPress Migrations

Migrating content to or from WordPress is a bit easier. Since it’s the platform is so popular and widely used, it’s compatible with whatever formats you were previously using or plan to use moving forward.

In some cases, your web hosting provider can handle WordPress migrations for you. Depending on the plan you have, this could be free or for a small fee of around $100.

If an expert is able to migrate your WordPress site for you, then I’d definitely take advantage of it. Even if you have to pay, it’s worth getting it done properly.

Best Website Builder For Site Migrations: WordPress

Migrations are a pain no matter what platform you’re using. Exporting and importing on both ends is usually a hassle. I’ve never met anyone who enjoys this.

But with that said, WordPress has the edge here because of its popularity. It’s more compatible with other platforms than Squarespace.

Customer Support

I always use customer service as a factor when I’m evaluating a product or service. I want my provider to be there for me whenever I need help or assistance.

Squarespace Support

Squarespace has excellent support. They have a dedicated IT team available 24/7 via live chat and email.

squarespace support

They also have an extensive knowledge base that’s easy to use for troubleshooting on your own. Squarespace offers webinars to teach you how to use their platform and improve your website.

As an all-in-one platform, Squarespace offers things like security, hosting, and a CDN standard with all plans. They handle all of the backend functions of your site so you won’t have to worry about anything.

WordPress Support

If you’re using WordPress, you need to be good at finding answers on your own.

Fortunately, WordPress has a massive community of users. So there are tons of forums and help articles available online.

Not every WordPress user has access to live support. Only paid plans will have this option, and the level of support offered depends on how much your paying.

Best Website Builder For Customer Service: Squarespace

The 24/7 live chat and email support offered by Squarespace is unbeatable. There is definitely more information about how to use WordPress on the web. But in terms of a dedicated support team, Squarespace is the winner.

Price

We can’t evaluate these website building platforms without comparing the prices.

Squarespace Price

Squarespace has four different plans, starting as low as $12 per month. Here’s a brief overview of the pricing tiers.

squarespace price

The plan you choose will depend on the type of website that you’re building. For example, if you plan on selling online, you’ll need the Basic Commerce plan, at a minimum.

But if you are running a small, simple, personal portfolio site, you can get away with the Personal plan, which is very cost-effective.

WordPress Price

WordPress is free. But if you want to upgrade to a premium plan, these are your options:

wordpress plans

If you’re just running a small blog, you can stick with the free plan or upgrade to the cheapest plan. But any other website should consider the Premium option, at a minimum.

Upgrading your WordPress plan gives you access to features like premium templates, marketing tools, and support.

The amount of storage you need will affect which plan you choose.

Best Value Website Builder: WordPress

The fact that you can use WordPress for free is a great option for new websites. The two entry-level WordPress plans are cheaper than the lowest Squarespace plan.

WordPress can cost as much or as little as you’d like. Some plugins will require payment, which adds on to your base cost.

Who is Squarespace For?

Squarespace is the best website builder for artists, musicians, photographers, fashion designers, and entrepreneurs. If you’re creative, but not technically-inclined, then you can build a beautiful website on Squarespace with the drag-and-drop builder.

As an all-in-one platform, Squarespace is very easy to manage and maintain. All of the features and tools come built-in, so you never have to worry about adding anything on.

Who is WordPress For?

WordPress is best for developers, programmers, bloggers, and webmasters who know how to code. If you want complete control over the look and feel of your website, WordPress gives you the ultimate ability to customize.

WordPress is pretty bare and limited out of the box. So it’s up to you to add plugins and code the site to meet your standards. It requires a bit more work, but the possibilities are endless.

Final Verdict: Which is Better?

Now to the burning question—which website builder is better? Squarespace or WordPress? Here’s a quick recap of the categories we evaluated above:

  • Ease of Use — Squarespace
  • Design — Squarespace
  • Features — Squarespace
  • Plugins and Apps — WordPress
  • SEO — WordPress
  • Blogging — WordPress
  • Ecommerce — Squarespace
  • Maintenance — Squarespace
  • Security — Squarespace
  • Content Ownership — WordPress
  • Support — Squarespace
  • Value — WordPress

Each website builder has its upsides and pitfalls. It all depends on what you’re looking for and what’s important to you.

Based on these factors alone, Squarespace wins 7-5. But with that said, WordPress is still a great option for lots of websites. We use WordPress at Quick Sprout, and I haven’t considered switching because it handles everything we could possibly need.

But what’s best for me may not be best for you. If you’re building a new website from scratch and you don’t have any coding experience, Squarespace will probably be your best option.

Still not sold on either of these platforms? Check out my guide on the best website builders for plenty of alternative solutions.

The Best Cocktail in Town

I admit I've held in a lot of pent-up frustration about the direction web development has taken the past few years. There is the complexity. It requires a steep learning curve. It focuses more on more configuration than it does development.

That's not exactly great news for folks like me who consider themselves to be more on the design side of the front-end spectrum. I remember grimacing the first time I found myself using a Grunt workflow on a project. Now, how I long for the "simplicity" of those days.

That's not to say I haven't enjoyed experimenting with new development workflows and frameworks. I actually find Vue to be pretty pleasant. But I think that might have to do with the fact that it's organized in a HTML-CSS-JS structure that feels familiar and that it works with straight-up HTML.

I'm finding myself rekindling my love for a development workflow that's as close to a vanilla combination of HTML, CSS, and JavaScript as I can get. Everything generally compiles back to these languages anyway. CSS has gotten more complex, yes, but it has also gotten more powerful and empowering (hello, CSS grid, custom properties, and calc!) to the point that using a preprocessor requires an intentional choice for me. And JavaScript? Yeah, it done got big, but it's getting nicer to write all the time.

HTML, CSS, and JavaScript: it's still the best cocktail in town.

If there's one new thing in the dev landscape that's caught my attention more than anything in the past year, it's the evolution of JAMstack. Hot dang if it isn't easier to deploy sites and changes to them while getting continuous delivery and a whole lot of performance value to boot. Plus, it abstracts server work to the extent that I no longer feel beholden to help from a back-end developer to set me up with different server environments, fancy testing tools, and deployment integrations. It's all baked into an online dashboard that I can configure in a matter of minutes. All hail the powerful front-end developer!

I've been building websites for nearly 20 years and I feel like the last five have seen the most changes in the way we develop for the web. Progressive web apps? Bundlers and tree-shaking? Thinking in components? Serverless? Yes, it's a crazy time for an old dog like me to learn new tricks, but it brings a level of excitement I haven't experienced since learning code the View Source way.

That's why I still find myself loving and using a classic workflow as much as I can in 2019, but can still appreciate the new treats we've gotten in recent years and how they open my mind up to new possibilities that challenge the status quo.

Cheers!

The post The Best Cocktail in Town appeared first on CSS-Tricks.

The Kind of Development I Like

I'm turning 40 next year (yikes!) and even though I've been making websites for over 25 years, I feel like I'm finally beginning to understand the kind of development I like. Expectedly, these are not new revelations and my views can be summed up by two older Computer Science adages that pre-date my career.

  1. Composition over inheritance
  2. Convention over configuration

Allow me to take you on a short journey. In modern component-driven web development, I often end up with or see structures like this:

<ComponentA>
  <ComponentB>
    <ComponentC />
  </ComponentB>
</ComponentA>

Going down this route is a system where everything is nested child components and props or data are passed down from parent components. It works, but for me, it zaps the fun out of programming. It feels more like plumbing than programming.

Seeing Mozilla's new ECSY framework targeted at 2D games and 3D virtual reality scenes, I immediately found myself gravitating towards its programming model where Components chain their behaviors onto objects called Entities.

EntityA
  .addComponent('ComponentA')
  .addComponent('ComponentB')

Hey! That looks like a chained jQuery method. I like this and not just for nostalgia's sake. It's the "composition" of functionality that I like. I know CSS is fraught with inheritance problems, but it reminds me of adding well-formed CSS classes. I gravitate towards that. Knowing I personally favor composition actually helped me resolve some weird inconsistent feelings on why I genuinely like React Hooks (composition) even though I'm not particularly fond of the greater React ecosystem (inheritance).

I think I must confess and apologize for a lot of misplaced anger at React. As a component system, it's great. I used it on a few projects but never really bonded with it. I think I felt shame that I didn't enjoy this very popular abstraction and felt out of sync with popular opinion. Now I think I understand more about why.

I should apologize to webpack too. As a bundling and tree shaking tool, it does a great job. It's even better when all the configuration is hidden inside tools like Angular CLI and Nuxt. My frustrations were real, but as I learn more about myself, I realized it might be something else...

My frustrations with modern web development have continued to tumble downwards in levels of abstraction. I now think about npm and wonder if it's somewhat responsible for some of the pain points of modern web development today. Fact is, npm is a server-side technology that we've co-opted on the client and I think we're feeling those repercussions in the browser.

The Unix Philosophy encourages us to write small micro libraries that do one thing and do it well. The Node.js Ecosystem did this in spades. This works great on the server where importing a small file has a very small cost. On the client, however, this has enormous costs. So we build processes and tools to bundle these 46,000 scripts together. But that obfuscates the end product. It's not uncommon that a site could be using fetch, axios, and bluebird all at the same time and all of lodash just to write a forEach loop.

In an "npm install your problems away" world, I feel like we do less programming and more configuring things we installed from the Internet. As dependencies grow in features and become more flexible, they allow you to configure some of the option flags. As a one-off, configs are a great feature. But cumulatively, even on a "simple" project, I can find myself managing and battling over a half dozen config files. One day while swimming in a sea of JSON configs it dawned on me: I don't like configuration.

"Convention over configuration" was a set of ideals popularized by David Heinemeier Hansson (@DHH) and it guided a lot of the design of Ruby on Rails. While the saying has waned in popularity some, I think it sums up the kind of development I like, especially when frameworks are involved. Frameworks should try to be a collection of best practices, to save others from having to overthink decisions. I've said it before, but I think Nuxt does this really well. When I step into a system of predefined conventions and minor configuration, I'm much happier than the opposite system of no conventions and lots of configuration.

It's a little weird to be turning 40 and discovering so much about the job I do on a daily basis. But it's nice to have found some vocabulary and principles for what I like about development. Your list of things you like may be different than mine and that's a good thing. I'd love to know more about the kind of development you like. What do you like to build? What are you optimizing for? What is your definition of success?

The post The Kind of Development I Like appeared first on CSS-Tricks.

We asked web developers we admire: “What about building websites has you interested this year?”

For the first time ever here on CSS-Tricks, we're going to do an end-of-year series of posts. Like an Advent calendar riff, only look at us, we're beating the Advent calendar rush! We'll be publishing several articles a day from a variety of web developers we look up to, where they were all given the same prompt:

What about building websites has you interested this year?

We're aiming for a bit of self-reflection and real honesty. As in, not what you think you should care about or hot takes on current trends, but something that has quite literally got you thinking. Our hope is that all put together, the series paints an interesting picture of where we are and where we're going in the web development industry.

We didn't directly ask people for their future predictions. Instead, we will perhaps get a glimpse of the future through seeing what is commanding the attention of developers today. I wanted to mention that because this series takes some inspiration from the one NeimanLabs runs each year (e.g. 2019, 2018, 2017...) which directly asks for people's predictions about journalism. Maybe we'll try that one year!

Automattic has a been a wonderful partner to us for a while now, and so I'm using this series as another way to thank them for that. Automattic are the makers of WordPress.com and big contributors to WordPress itself, which is what this site runs on. They also make premium plugins like WooCommerce and Jetpack, which we also use.

Stay tuned for all the wonderful thoughts we'll be publishing this week (hey, I even hear RSS is still cool) or bookmark the homepage for the series.

The post We asked web developers we admire: “What about building websites has you interested this year?” appeared first on CSS-Tricks.

Ways to Organize and Prepare Images for a Blur-Up Effect Using Gatsby

Gatsby does a great job processing and handling images. For example, it helps you save time with image optimization because you don’t have to manually optimize each image on your own.

With plugins and some configuration, you can even setup image preloading and a technique called blur-up for your images using Gatsby. This helps with a smoother user experience that is faster and more appealing.

I found the combination of gatsby-source-filesystem, GraphQL, Sharp plugins and gatsby-image quite tedious to organize and un-intuitive, especially considering it is fairly common functionality. Adding to the friction is that gatsby-image works quite differently from a regular <img> tag and implementing general use cases for sites could end up complex as you configure the whole system.

Medium uses the blur-up technique for images.

If you haven’t done it already, you should go through the gatsby-image docs. It is the React component that Gatsby uses to process and place responsive, lazy-loaded images. Additionally, it holds the image position which prevents page jumps as they load and you can even create blur-up previews for each image.

For responsive images you’d generally use an <img> tag with a bunch of appropriately sized images in a srcset attribute, along with a sizes attribute that informs the layout situation the image will be used in.

<img srcset="img-320w.jpg 320w,
              img-480w.jpg 480w,
              img-800w.jpg 800w"
      sizes="(max-width: 320px) 280px,
            (max-width: 480px) 440px,
            800px"
      src="img-800w.jpg">

You can read up more on how this works in the Mozilla docs. This is one of the benefits of using gatsby-image in the first place: it does all the resizing and compressing automatically while doing the job of setting up srcset attributes in an <img /> tag.

Directory structure for images

Projects can easily grow in size and complexity. Even a single page site can contain a whole bunch of image assets, ranging from icons to full-on gallery slides. It helps to organize images in some order rather than piling all of them up in a single directory on the server. This helps us set up processing more intuitively and create a separation of concerns.

While attempting to organize files, another thing to consider is that Gatsby uses a custom webpack configuration to process, minify, and export all of the files in a project. The generated output is placed in a /public folder. The overall structure gatsby-starter-default uses looks like this:

/
|-- /.cache
|-- /plugins
|-- /public
|-- /src
    |-- /pages
    |-- /components
    |-- /images
    |-- html.js
|-- /static (not present by default)
|-- gatsby-config.js
|-- gatsby-node.js
|-- gatsby-ssr.js
|-- gatsby-browser.js

Read more about how the Gatsby project structure works here.

Let’s start with the common image files that we could encounter and would need to organize

For instance:

  • icons
  • logos
  • favicon
  • decorative images (generally vector or PNG files)
  • Image gallery (like team head shots on an About page or something)

How do we group these assets? Considering our goal of efficiency and the Gatsby project structure mentioned above, the best approach would be to split them into two groups: one group that requires no processing and directly imported into the project; and another group for images that require processing and optimization.

Your definitions may differ, but that grouping might look something like this:

Static, no processing required:

  • icons and logos that require no processing
  • pre-optimized images
  • favicons
  • other vector files (like decorative artwork)

Processing required:

  • non-vector artwork (e.g. PNG and JPG files)
  • gallery images
  • any other image that can be processed, which are basically common image formats other than vectors

Now that we have things organized in some form of order, we can move onto managing each of these groups.

The "static" group

Gatsby provides a very simple process for dealing with the static group: add all the files to a folder named static at the root of the project. The bundler automatically copies the contents to the public folder where the final build can directly access the files.

Say you have a file named logo.svg that requires no processing. Place it in the static folder and use it in a component file like this:

import React from "react"

// Tell webpack this JS file requires this image
import logo from "../../static/logo.svg" 

function Header() {
  // This can be directly used as image src
  return <img src={logo} alt="Logo" />
}

export default Header

Yes, it’s as simple as that — much like importing a component or variable and then directly using it. Gatsby has detailed documentation on importing assets directly into files you could refer to for further understanding.

Special case: Favicon

The plugin gatsby-plugin-manifest not only adds a manifest.json file to the project but also generates favicons for all required sizes and links them up in the site.

With minimal configuration, we have favicons, no more manually resizing, and no more adding individual links in the HTML head. Place favicon.svg (or .png or whatever format you’re using) in the static folder and tweak the gatsby-config.js file with settings for gatsby-plugin-manifest

{
  resolve: `gatsby-plugin-manifest`,
  options: {
    name: `Absurd`,
    icon: `static/favicon.svg`,
  },
},

The "processed" group

Ideally, what we’d like is gatsby-image to work like an img tag where we specify the src and it does all the processing under the hood. Unfortunately, it’s not that straightforward. Gatsby requires you to configure gatsby-source-filesystem for the files then use GraphQL to query and processed them using Gatsby Sharp plugins (e.g. gatsby-transformer-sharp, gatsby-plugin-sharp) with gatsby-image. The result is a responsive, lazy-loaded image.

Rather than walking you through how to set up image processing in Gatsby (which is already well documented in the Gatsby docs), I’ll show you a couple of approaches to optimize this process for a couple of common use cases. I assume you have a basic knowledge of how image processing in Gatsby works — but if not, I highly recommend you first go through the docs.

Use case: An image gallery

Let’s take the common case of profile images on an About page. The arrangement is basically an array of data with title, description and image as a grid or collection in a particular section.

The data array would be something like:

const TEAM = [
  {
    name: 'Josh Peck',
    image: 'josh.jpg',
    role: 'Founder',
  },
  {
    name: 'Lisa Haydon',
    image: 'lisa.jpg',
    role: 'Art Director',
  },
  {
    name: 'Ashlyn Harris',
    image: 'ashlyn.jpg',
    role: 'Frontend Engineer',
  }
];

Now let’s place all the images (josh.jpg, lisa.jpg and so on) in src/images/team You can create a folder in images based on what group it is. Since we’re dealing with team members on an About page, we’ve gone with images/team The next step is to query these images and link them up with the data.

To make these files available in the Gatsby system for processing, we use gatsby-source-filesystem. The configuration in gatsby-config.js for this particular folder would look like:

{
  resolve: `gatsby-source-filesystem`,
  options: {
    name: `team`,
    path: `${__dirname}/src/images/team`,
  },
  `gatsby-transformer-sharp`,
  `gatsby-plugin-sharp`,
},

To query for an array of files from this particular folder, we can use sourceInstanceName It takes the value of the name specified in gatsby-config.js:

{
  allFile(filter: { sourceInstanceName: { eq: "team" } }) {
    edges {
      node {
        relativePath
        childImageSharp {
          fluid(maxWidth: 300, maxHeight: 400) {
            ...GatsbyImageSharpFluid
          }
        }
      }
    }
  }
}

This returns an array:

// Sharp-processed image data is removed for readability
{
  "data": {
    "allFile": {
      "edges": [
        {
          "node": {
            "relativePath": "josh.jpg"
          }
        },
        {
          "node": {
            "relativePath": "ashlyn.jpg"
          }
        },
        {
          "node": {
            "relativePath": "lisa.jpg"
          }
        }
      ]
    }
  }

As you can see, we’re using relativePath to associate the images we need to the item in the data array. Some quick JavaScript could help here:

// Img is gatsby-image
// TEAM is the data array

TEAM.map(({ name, image, role }) => {
  // Finds associated image from the array of images
  const img = data.allFile.edges.find(
    ({ node }) => node.relativePath === image
  ).node;

  return (
    <div>
      <Img fluid={img.childImageSharp.fluid} alt={name} />
      <Title>{name}</Title>
      <Subtitle>{role}</Subtitle>
    </div>
  );
})

That’s the closest we’re getting to using src similar to what we do for <img> tags.

Use case: Artwork

Although artwork may be created using the same type of file, the files are usually spread throughout the in different sections (e.g. pages and components), with each usually coming in different dimensions.

It’s pretty clear that querying the whole array, as we did previously, won’t wor. However, we can still organize all the images in a single folder. That means we an still use sourceInstanceName for specifying which folder we are querying the image from.

Similar to our previous use case, let’s create a folder called src/images/art and configure gatsby-source-filesystem. While querying, rather than getting the whole array, here we will query for the particular image we need in the size and specification as per our requirements:

art_team: file(
    sourceInstanceName: { eq: "art" }
    name: { eq: "team_work" }
  ) {
    childImageSharp {
    fluid(maxWidth: 1600) {
      ...GatsbyImageSharpFluid
    }
  }
}

This can be directly used in the component:

<Img fluid={data.art_team.childImageSharp.fluid} />

Further, this can be repeated for each component or section that requires an image from this group.

Special case: Inlining SVGs

Gatsby automatically encodes smaller images into a base64 format and places the data inline, reducing the number of requests to boost performance. That's great in general, but might actually be a detriment to SVG files. Instead, we can manually wrangle SVGs to get the same performance benefits, or in the case we might want to make things more interactive, incorporate animations.

I found gatsby-plugin-svgr to be the most convenient solution here. It allows us to import all SVG files as React components:

import { ReactComponent as GithubIcon } from './github.svg';

Since we’re technically processing SVG files instead of raster images, it’d make sense to move the SVG file out of static folder and place it in the folder of the component that’s using it.

Conclusion

After working with Gatsby on a couple of projects, these are a few of the ways I overcame hurdles when working with images to get that nice blur-up effect. I figured they might come handy for you, particularly for the common use cases we looked at.

All the conventions used here came from the gatsby-absurd starter project I set up on GitHub. Here's the result:

It’s a good idea to check that out if you’d like to see examples of it used in a project. Take a look at Team.js to see how multiple images are queried from the same group. Other sections — such as About.js and Header.js — illustrate how design graphics (the group of images shared across different sections) are queried. Footer.js and Navbar.js have examples for handling icons.

The post Ways to Organize and Prepare Images for a Blur-Up Effect Using Gatsby appeared first on CSS-Tricks.

The Department of Useless Images

Gerry McGovern:

The Web is smothering in useless images. These clichéd, stock images communicate absolutely nothing of value, interest or use. They are one of the worst forms of digital pollution because they take up space on the page, forcing more useful content out of sight. They also slow down the site’s ability to download quickly.

:laugh: :cry:

It's so true, isn't it? How much bandwidth and electricity is spent sending middle-aged-man-staring-into-camera.jpg?

Great photography can be a powerful emotional trigger and be a distinguishing feature of a design, but there is a line between that and some random Unsplash thing. (Says the guy who absolutely loves the Unsplash integration on Notion.)

Direct Link to ArticlePermalink

The post The Department of Useless Images appeared first on CSS-Tricks.

15 Mind-bending Three.js JavaScript Experiments

3D browser animation just keeps getting more powerful, and web developers are taking an interest. WebGL, Three.js, and other JavaScript APIs and libraries have been around for a while, but many browsers and computers didn’t have the capacity to run advanced animations without significant slowdown.

But as software and hardware becomes more effective at dealing with complex 3D environments, it’s now much more common to see websites rendering animations. Three.js is particularly useful thanks to its ability to run without any plugins. With this powerful library, web developers can create jaw-dropping animations or even simple video games.

Ready to have your mind blown? Here are a few examples of gorgeous Three.js experiments that take full advantage of the library’s capabilities.

Lab City 3D

See the Pen
City 3D
by Victor Vergara (@vcomics)
on CodePen.

Playing with Sound

See the Pen
Playing with sound and three.js
by Sarah Drasner (@sdras)
on CodePen.

three.js Points Anti-Gravity

See the Pen
three.js Points anti-gravity is applied ver2
by yoichi kobayashi (@ykob)
on CodePen.

WebGL Distortion Slider

See the Pen
WebGL Distortion Slider
by Ash Thornton (@ashthornton)
on CodePen.

Test of Three.js and Tween.js

See the Pen
Test of Three.js and Tween.js
by cx20 (@cx20)
on CodePen.

three.js canvas – particles – waves

See the Pen
three.js canvas – particles – waves
by deathfang (@deathfang)
on CodePen.

WormHole

See the Pen
WormHole
by Josep Antoni Bover Comas (@devildrey33)
on CodePen.

Wire Typo

See the Pen
Wire Typo
by ilithya (@ilithya)
on CodePen.

THREE.js Particle Stream

See the Pen
THREE.js particle stream
by Szenia Zadvornykh (@zadvorsky)
on CodePen.

Perlin Noise

See the Pen
Perlin Noise
by Victor Vergara (@vcomics)
on CodePen.

Three Js Point Cloud Experiment

See the Pen
Three Js Point Cloud Experiment
by Sean Dempsey (@seanseansean)
on CodePen.

Shader Moon

See the Pen
Shader Moon
by Victor Vergara (@vcomics)
on CodePen.

3D Floating Typo

See the Pen
3D Floating Typo
by ilithya (@ilithya)
on CodePen.

RetroFighter Gunship

See the Pen
RetroFighter Gunship
by Rainner Lins (@rainner)
on CodePen.

Pixel Particles

See the Pen
Pixel Particles
by Szenia Zadvornykh (@zadvorsky)
on CodePen.

Mind-Blowing Three.js Experiments

Developers are always creating awesome new code experiments that do cool new functions or are just made to look beautiful. It’s a good idea to keep up with sites like CodePen so you can see how devs are pushing the limits of libraries like Three.js. There’s always someone trying something new and interesting.

And the best part is you can also use pens in your own open source websites and projects, or learn from them yourself and try making your own experiments. Learn from your fellow developers, fork their code to try your own ideas, and you’ll quickly learn the nuances of Three.js animation.

UNLIMITED DOWNLOADS: Email, admin, landing page & website templates




Collective #566



C566_gifolio

Gifolio

Gifolio is a brilliant collection of design portfolios presented using animated GIFs. By Roll Studio.

Check it out



C566_masks

Masks

An interactive presentation on masking techniques originally created for a Creative Front-end Belgium meetup hosted by Reed. By Thomas Di Martino.

Check it out




C566_mike

Supermaya

Supermaya is an Eleventy starter kit designed to help you add rich features to a blog or website without the need for a complicated build process.

Check it out


C566_darkmode

Dark Mode

Varun Vachhar shares the challenges he encountered when migrating from Jekyll to Gatsby related to dark mode.

Read it












C566_fresh

Fresh Folk

A beautiful mix-and-match illustration library of people and objects made by Leni Kauffman.

Check it out


C566_arcticvault

GitHub Archive Program

The GitHub Archive Program will safely store every public GitHub repo for 1,000 years in the Arctic World Archive in Svalbard, Norway.

Check it out



Collective #566 was written by Pedro Botelho and published on Codrops.

10+ Best Laravel Admin Templates for 2019/2020 (Free and Premium)

Nowadays, app-building doesn’t have to start from scratch. In this post, we look at some of the best Laravel admin templates that can serve as the foundation of your next app or web project. Give yourself a head start! These Laravel admin templates take away much of the grunt work and help to create apps to match every need.

Abstracting WordPress Code To Reuse With Other CMSs: Concepts (Part 1)

Abstracting WordPress Code To Reuse With Other CMSs: Concepts (Part 1)

Abstracting WordPress Code To Reuse With Other CMSs: Concepts (Part 1)

Leonardo Losoviz

Making code that is agnostic of the CMS or framework has several benefits. For instance, through its new content editor Gutenberg, WordPress enables to code components which can be used for other CMSs and frameworks too, such as for Drupal and for Laravel. However, Gutenberg’s emphasis on re-utilization of code is focused on the client-side code of the component (JavaScript and CSS); concerning the component’s backend code (such as the provision of APIs that feed data to the component) there is no pre-established consideration.

Since these CMSs and frameworks (WordPress, Drupal, Laravel) all run on PHP, making their PHP code re-usable too will make it easier to run our components on all these different platforms. As another example, if we ever decide to replace our CMS with another one (as has recently happened that many people decried WordPress after its introduction of Gutenberg), having the application code be agnostic from the CMS simplifies matters: The more CMS-agnostic our application code is, the less effort will be required to port it to other platforms.

Starting with application code built for a specific CMS, the process of transforming it to CMS-agnostic is what, in this article, I will call “abstracting code”. The more abstract the code is, the more it can be re-used to work with whichever CMS.

Making the application completely CMS-agnostic is very tough though — even possibly impossible — since sooner or later it will need to depend on the specific CMS’s opinionatedness. Then, instead of attempting to achieve 100% code reusability, our goal must simply be to maximize the amount of code that is CMS-agnostic to make it reusable across different CMSs or frameworks (for the context of this article, these 2 terms will be used interchangeably). Then, migrating the application to a different framework will be not without pain, but at least it will be as painless as possible.

The solution to this challenge concerns the architecture of our application: We must keep the core of the application cleanly decoupled from the specifics of the underlying framework, by coding against interfaces instead of implementations. Doing so will grant additional benefits to our codebase: We can then focus our attention almost exclusively on the business logic (which is the real essence and purpose of the application), causing the code to become more understandable and less muddled with the limitations imposed by the particular CMS.

This article is composed of 2 parts: In this first part we will conceptualize and design the solution for abstracting the code from a WordPress site, and on the 2nd part we will implement it. The objective shall be to keep the code ready to be used with Symfony components, Laravel framework, and October CMS.

Code Against Interfaces, Rely On Composer, Benefit From Dependency Injection

The design of our architecture will be based on the following pillars:

  1. Code against interfaces, not implementations.
  2. Create packages, distribute them through Composer.
  3. Dependency Injection to glue all parts together.

Let’s analyze them one by one.

Code Against Interfaces, Not Implementations

Coding against interfaces is the practice of interacting with a certain piece of code through a contract. A contract, which is set up through an interface from our programming language (PHP in our case since we are dealing with WordPress), establishes the intent of certain functionality, by explicitly stating what functions are available, what inputs are expected for each function, and what each function will return, and it is not concerned with how the functionality must be implemented. Then, our application can be cleanly decoupled from a specific implementation, not needing to know how its internals work, and being able to change to another implementation at any time without having to drastically change code. For instance, our application can store data by interacting with an interface called DataStoreInterface instead of any of its implementations, such as instances of classes DatabaseDataStore or FilesystemDataStore.

In the context of WordPress, this implies that — by the end of the abstraction — no WordPress code will be referenced directly, and WordPress itself will simply be a service provider for all the functions that our application needs. As a consequence, we must consider WordPress as a dependency of the application, and not as the application itself.

Contracts and their implementations can be added to packages distributed through Composer and glued together into the application through dependency injection which are the items we will analyze next.

Create Packages, Distribute Them Through Composer

Remember this: Composer is your friend! This tool, a package manager for PHP, allows any PHP application to easily retrieve packages (i.e. code) from any repository and install them as dependencies.

Note: I have already described how we can use Composer together with WordPress in a previous article I wrote earlier this year.

Composer is itself CMS-agnostic, so it can be used for building any PHP application. Packages distributed through Composer, though, may be CMS-agnostic or not. Therefore, our application should depend on CMS-agnostic packages (which will work for any CMS) as much as possible, and when not possible, depend on the corresponding package that works for our specific CMS.

This strategy can be used to code against contracts, as explained earlier on. The packages for our application can be divided into two types: CMS-agnostic and CMS-specific ones. The CMS-agnostic package will contain all the contracts and all generic code, and the application will exclusively interact with these packages. For each CMS-agnostic package containing contracts, we must also create a CMS-specific package containing the implementation of the contracts for the required CMS, which is set into the application by means of dependency injection (which we’ll analyze below).

For example, to implement an API to retrieve posts, we create a CMS-agnostic package called “Posts”, with contract PostAPIInterface containing function getPosts, like this:

interface PostAPIInterface
{
  public function getPosts($args);
}

This function can be resolved for WordPress through a package called “Posts for WordPress”, which resolves the contract through a class WPPostAPI, implementing function getPosts to simply execute WordPress function get_posts, like this:

class WPPostAPI implements PostAPIInterface
{
  public function getPosts($args) {
    return get_posts($args);
  }
}

If we ever need to port our application from WordPress to another CMS, we must only implement the corresponding CMS-specific package for the new CMS (e.g. “Posts for October CMS”) and update the dependency injection configuration matching contracts to implementations, and that’s it!

Note: It is a good practice to create packages that only define contracts and nothing else. This way, it is easy for implementers to know exactly what must be implemented.

Dependency Injection To Glue All Parts Together

Dependency injection is a technique that allows declaring which object from the CMS-specific package (aka the “service provider”) is implementing which interface from the CMS-agnostic package (aka the “contract”), thus gluing all parts of the application together in a loosely-coupled manner.

Different CMSs or frameworks may already ship with their own implementation of a dependency injection component. For instance, whereas WordPress doesn’t have any, both Symfony and Laravel have their own solutions: DependencyInjection component and Service Container respectively.

Ideally, we should keep our application free from choosing a specific dependency injection solution, and leave it to the CMS to provide for this. However, dependency injection must be used also to bind together generic contracts and services, and not only those depending on the CMS (for instance, a contract DataStoreInterface, resolved through service provider FilesystemDataStore, may be completely unrelated to the underlying CMS). In addition, a very simple application that does not require an underlying CMS will still benefit from dependency injection. Hence, we are compelled to choose a specific solution for dependency injection.

Note: When choosing a tool or library, prioritize those ones which implement the corresponding PHP Standards Recommendation (in our case, we are interested in PSR-11), so they can be replaced without affecting the application code as much as possible (in practice, each solution will most likely have a custom initialization, so some re-writing of application code may be unavoidable).

Choosing The Dependency Injection Component

For my application, I have decided to use Symfony’s DependencyInjection component which, among other great features, can be set-up through YAML and XML configuration files, and it supports autowiring, which automatically resolves how different services are injected into one another, greatly reducing the amount of configuration needed.

For instance, a service Cache implementing a contract CacheInterface, like this one:

namespace MyPackage\MyProject;
class Cache implements CacheInterface
{
  private $cacheItemPool;
  private $hooksAPI;

  public function __construct(
    CacheItemPoolInterface $cacheItemPool, 
    HooksAPIInterface $hooksAPI
  ) {
    $this->cacheItemPool = $cacheItemPool;
    $this->hooksAPI = $hooksAPI;
  }

  // ...
}

… can be set as the default service provider through the following services.yaml configuration file:

services:
  _defaults:
    bind:
      MyPackage\MyProject\HooksAPIInterface: '@hooks_api'

  hooks_api:
    class: \MyPackage\MyProject\ContractImplementations\HooksAPI

  cache:
    class: \MyPackage\MyProject\Cache
    public: true
    arguments:
      $cacheItemPool: '@cache_item_pool'

  cache_item_pool:
    class: \Symfony\Component\Cache\Adapter\FilesystemAdapter

As it can be observed, class cache requires two parameters in its constructor, and these are resolved and provided by the dependency injection component based on the configuration. In this case, while parameter $cacheItemPool is manually set, parameter $hooksAPI is automatically resolved through type-hinting (i.e. matching the expected parameter’s type, with the service that resolves that type). Autowiring thus helps reduce the amount of configuration required to glue the services and their implementations together.

Make Your Packages As Granular As Possible

Each package must be as granular as possible, dealing with a specific objective, and containing no more or less code than is needed. This is by itself a good practice in order to avoid creating bloated packages and establishing a modular architecture, however, it is mandatory when we do not know which CMS the application will run on. This is because different CMSs are based on different models, and it is not guaranteed that every objective can be satisfied by the CMS, or under what conditions. Keeping packages small and objective then enables to fulfill the required conditions in a progressive manner, or discard using this package only when its corresponding functionality can’t be satisfied by the CMS.

Let’s take an example: If we come from a WordPress mindset, we could initially assume that entities “posts” and “comments” will always be a part of the Content Management System, and we may include them under a package called “CMS core”. However, October CMS doesn’t ship with either posts or comments in its core functionality, and these are implemented through plugins. For the next iteration, we may decide to create a package to provide for these two entities, called “Posts and Comments”, or even “Posts” under the assumption that comments are dependent on posts and bundled with them. However, once again, the plugins in October CMS don’t implement these two together: There is a plugin implementing posts and another plugin implementing comments (which has a dependency on the posts plugin). Finally, our only option is to implement two separate packages: “Posts” and “Comments”, and assign a dependency from the latter to the former one.

Likewise, a post in WordPress contains post meta attributes (i.e. additional attributes to those defined in the database model) and we may assume that every CMS will support the same concept. However, we can’t guarantee that another CMS will provide this functionality and, even if it did, its implementation may be so different than that from WordPress that not the same operations could be applied to the meta attributes.

For example, both WordPress and October CMS have support for post meta attributes. However, whereas WordPress stores each post meta value as a row on a different database table than where the post is stored, October CMS stores all post meta values in a single entry as a serialized JSON object in a column from the post table. As a consequence, WordPress can fetch posts filtering data based on the meta value, but October CMS cannot. Hence, the package “Posts” must not include the functionality for post meta, which must then be implemented on its own package “Post Meta” (satisfiable by both WordPress and October CMS), and this package must not include functionality for querying the meta attributes when fetching posts, which must then be implemented on its own package “Post Meta Query” (satisfiable only by WordPress).

Identifying Elements That Need To Be Abstracted

We must now identify all the pieces of code and concepts from a WordPress application that need be abstracted for it to run with any other CMS. Digging into an application of mine, I identified the following items:

  • accessing functions
  • function names
  • function parameters
  • states (and other constant values)
  • CMS helper functions
  • user permissions
  • application options
  • database column names
  • errors
  • hooks
  • routing
  • object properties
  • global state
  • entity models (meta, post types, pages being posts, and taxonomies —tags and categories—)
  • translation
  • media

As long as it is, this list is not yet complete. There are many other items that need abstraction, which I will not presently cover. Such items include dealing with the location of assets (some framework may require to place image/font/JavaScript/CSS/etc. files on a specific directory) and CLI commands (WordPress has WP-CLI, Symfony has the console component, and Laravel has Artisan, and there are commands for each of these which could be unified).

In the next (and final) part of this series of articles, we will proceed to implement the abstraction for all the items identified above.

Evaluating When It Makes Sense To Abstract The Application

Abstracting an application is not difficult, but, as shall be observed in the next article, it involves plenty of work, so we must consider carefully if we really need it or not. Let’s consider the advantages and disadvantages of abstracting the application’s code:

Advantages

  • The effort required to port our application to other platforms is greatly reduced.
  • Because the code reflects our business logic and not the opinionatedness of the CMS, it is more understandable.
  • The application is naturally organized through packages which provide progressive enhancement of functionalities.

Disadvantages

  • Extra ongoing work.
  • Code becomes more verbose.
  • Longer execution time from added layers of code.

There is no magic way to determine if we’ll be better off by abstracting our application code. However, as a rule of thumb, I’ll propose the following approach:

Concerning a new project, it makes sense to establish an agnostic architecture, because the required extra effort is manageable, and the advantages make it well worth it; concerning an existing project, though, the one-time effort to abstract it could be very taxing, so we should analyze what is more expensive (in terms of time and energy): the one-time abstraction, or maintaining several codebases.

Conclusion

Setting-up a CMS-agnostic architecture for our application can allow to port it to a different platform with minimal effort. The key ingredients of this architecture are to code against interfaces, distribute these through granular packages, implement them for a specific CMS on a separate package, and tie all parts together through dependency injection.

Other than a few exceptions (such as deciding to choose Symfony’s solution for dependency injection), this architecture attempts to impose no opinionatedness. The application code can then directly mirror the business logic, and not the limitations imposed by the CMS.

In the next part of this series, we will implement the code abstraction for a WordPress application.

Smashing Editorial (rb, dm, yk, il)

How to Clear Your DNS Cache (Mac, Windows, Chrome)

Have you even been asked to clear your DNS cache? It is a troubleshooting tip that helps you get to the latest version of a website, particularly after DNS changes.

DNS information tells your browser where to find a website. Your computer keeps this information in its cache to quickly point browsers in the right direction.

In this article, we’ll show you how to clear your DNS cache on Mac, Windows, and Chrome. This will allow you to easily refresh DNS records stored on your device and help you troubleshoot website issues.

Easily clear DNS cache in macOS, Windows, and Chrome

Here is a quick overview of what we’ll cover in this guide:

What is DNS Cache?

DNS cache is like an address book saved on your computer with the domain name server (DNS) information of each website you visit.

DNS or Domain Name Server is a technology that tells your computer the IP address associated with a domain name. To learn more, see our guide on how domain names work.

Saving the DNS information in a local DNS cache helps your browser quickly find a website.

Once you enter a website address in your browser, it will look for DNS information in the local cache first. If it finds the directions, then it uses the DNS cache to visit the website.

On the other hand, if the information is not in the local DNS cache, then the browser will get it from other DNS servers across the internet.

This ensures that every time you visit any website, your browser takes the shortest route to get the DNS information it needs to locate the website on the internet.

How domain names and DNS work

However, this may sometime cause trouble. For example, when you are moving a WordPress site to a new domain name or when you are moving WordPress to a new host.

DNS information may not get updated quickly on your computer, and you may end up visiting the old website or see a not found error. It will eventually get updated, but why wait when you can clear DNS cache right away.

Let’s take a look at how to clear DNS cache across various platforms.

How to Clear DNS Cache in Windows

If you are using a windows computer, then here is how you would clear DNS cache on your device.

First, you need to click on the start button and select the CMD (command prompt) tool.

Opening command prompt in Windows

This will launch a command prompt window. Inside it you need to enter the following text:

ipconfig /flushdns

Clearing DNS cache in Windows

Click on the enter button to execute the command and Windows will flush the DNS cache.

That’s all, you can now resume visiting your website to fetch the updated DNS information.

How to Clear DNS Cache on macOS

If you are on a Mac computer, then follow the steps below to clear your DNS cache.

First, you need to launch the Terminal app. You can find it in the Launchpad under the ‘Other’ folder. You can also launch it by opening Finder and going to Applications » Utilities folder.

Launching terminal

This will launch the terminal window where you need to enter the following command.

sudo killall -HUP mDNSResponder

Clearing DNS cache using terminal on macOS

You’ll be asked to enter your macOS account password. It is the same password you use to log into your computer.

After that, your computer will flush the DNS cache. You can now visit the website to get the latest DNS information.

Clear DNS Cache in Chrome

Google Chrome also keeps a DNS cache of its own, and it is separate from the DNS cache stored by your operating system.

If you use Google Chrome as your main browser, then you’ll need to clear Chrome’s DNS cache as well.

First, you need to enter the following address in your browser’s address bar and press enter on your keyboard.

chrome://net-internals/#dns

Clearing Google Chrome DNS cache

This will load Chrome’s net internal settings page. From here you need to click on the ‘Clear host cache’ button, and Chrome will clear up its DNS cache.

Now keep in mind that DNS cache is separate from the browser cache.

Your browser saves a lot of website data in a temporary cache to quickly load pages on subsequent visits.

If you are having trouble viewing a page that you updated but can’t see your changes, then you would want to clear the browser cache.

We have a step by step guide on how to clear browser cache on all major browsers that you can follow.

How to Check for DNS Updates

When you are moving your WordPress website to a host or transferring your domain registration to a new domain registrar, you’ll have to change your DNS settings and point them to the new location.

Once you apply these changes under your domain settings, it takes a while for changes to propagate across the internet. This could take anywhere between a few hours to a couple of days.

During this time, your domain will sometime point to the old location and sometimes it will point to the new location. This depends on your geographic location and which DNS servers your browser asks for directions.

You can check how these DNS changes are propagated around the world using online tools like DNS Checker.

Simply enter your domain name, and it will fetch DNS from different geographic locations spread around the world.

Check for DNS updates

If all locations indicate the same IP address with a green checkmark, then this means the DNS changes you made are now updated all over the internet.

We hope this article helped you learn how to easily clear your DNS cache on different devices. You may also want to see our guide on how to clear your WordPress cache for beginners.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Clear Your DNS Cache (Mac, Windows, Chrome) appeared first on WPBeginner.