No-Class CSS Frameworks

I linked up Water.css not long ago as an interesting sort of CSS framework. No classes. No <h2 class="is-title">. You just use semantic HTML and get styles. Is that going to “scale” very far? Probably not, but it sure is handy for styling things quickly, where — of course — you’re writing semantic HTML but don’t need to care tremendously about the look, other than it should look as decent as it can with low effort.

This week I saw MVP.css making the rounds. Same idea. There are a bunch more!

Even Foundation, while being a big honkin’ framework, does some pretty decent stuff classless-ly™.

The post No-Class CSS Frameworks appeared first on CSS-Tricks.

How to Start a WordPress Business

How To Start A WordPress Based BusinessIs it possible to build a successful business around WordPress today? The short answer is yes. In 2020 there are millions of freelancers earning a living online – and many of them have businesses they created around WordPress. There are solid reasons for this: WordPress continues to grow as a simple and versatile publishing platform […]

The post How to Start a WordPress Business appeared first on WPExplorer.

The Road Ahead: What’s in Store for WordPress for the Rest of 2020?

Full-site editing, automatic theme and plugin updates, global styles, and more await. With the release of WordPress 5.4 and an open call version 5.5 tickets, it is time to peer into the future and catch a glimpse of what is to come. It is shaping up to be an exciting year thus far.

Josepha Haden, executive director of WordPress, provided a progress update on the 2020 goals in early March. As always, the timeline to hit certain goals can change based on roadblocks the development team hits and other factors. On the whole, the tentative roadmap looks feasible.

Currently, WordPress 5.5 is set to ship on August 11, 2020. Version 5.6 is scheduled to follow on December 8, 2020. Some major changes are forthcoming. Let us take a moment to look ahead and see where the WordPress ship is sailing.

Automatic Updates for Everything

Screenshot of the plugin management screen with a new automatic updates column.
Automatic updates column on the plugin management screen.

We have enjoyed automatic updates for minor versions of core WordPress since version 3.7. However, until recently, it has felt like progress on auto-updating everything had stalled. From mobile phones to smart TVs, the average end-user is accustomed to their software simply staying updated. In 2020, it is time WordPress continues pushing forward, particularly when staying updated is one component of maintaining a secure website.

There are two separate changes centered on automatic updates in the pipeline. The first, which is set to ship in WordPress 5.5, is automatic updates for plugins and themes. The feature plugin has been in development for several months and should be stable enough to launch with the next version of WordPress.

Plugin and theme developers will need to adopt a development strategy that aligns more with the WordPress philosophy of maintaining backward compatibility, at least to the point where an automatic update does not break a user’s site. This change is a welcome one because it will lead to a more secure web. However, it will be interesting to see how this plays out in the months to come. I am certain there will be a road bump or two that the developer community will need to overcome.

Automatic updates of core WordPress is slated to officially land in version 5.6. It should be an opt-in feature when it rolls out. The feature plugin should also be ready by the time WordPress 5.5 lands.

Block Directory Integration

Screenshot of the block directory page on WordPress.org.
WordPress.org’s block directory page.

The block directory first landed in Gutenberg 6.5 as an experimental feature. For those of us running the plugin, it is almost easy to forget that it is not already a part of WordPress.

The block directory is a listing of a special type of plugin that adds only a single block. In WordPress 5.5, users should be able to search and install blocks from this directory via the post editing screen. If you need a block that is not installed, you can install and begin using it without going through the normal routine with installing a plugin.

Full-Site Editing

Live Demo Q&A from The Gutenberg Times.

I am excited about the prospect of full-site editing landing in WordPress. I am concerned that a target date within 2020 may be rushing a feature that may not be ready. I want this to be a successful transition of how themes work and how users interact with their sites. I am optimistic about this future, but I am not convinced it will be good enough by the time WordPress 5.6 ships.

Aside from the introduction of the block editor itself, this will be one of the largest changes to how WordPress works in its history. Arguably, it is a more wide-reaching change because it touches both the backend user interface and how the theme templating system functions. It needs time to age before it’s dropped into the laps of end-users and developers alike.

I will be the first to jump for joy if I am wrong.

Currently, the plan is to complete the full-site editing feature in the Gutenberg plugin by the time WordPress 5.5 launches. It should still be behind the experimental flag in the plugin at that point. Then, ship the finished product in version 5.6.

Block Areas (Widgets)

Screenshot of the experimental block areas screen in the Gutenberg plugin.
Using blocks on the experimental block areas screen.

One of the features that has not gotten near enough attention is the conversion of traditional sidebars into block areas. This is a much-needed change in the mission to turn everything into a block.

Currently, it is planned to ship in WordPress 5.6, alongside full-site editing. I would rather see block areas as a stepping stone toward full-site editing. It would be less painful for theme authors to have at least a major release to ease into the next step.

The development of this feature could have been much smoother if WordPress would have simply deprecated sidebars and widgets. The Gutenberg team has had to pigeonhole a block-based system into the old widgets system. It is a little messy. Instead of the current approach, they should have created a separate system and allowed theme developers to begin opting into it. Because theme authors are the ones who will be handling support requests from end-users, they should have been given the power to handle that transition gracefully.

Overall, there should be no issue making sure block areas are feature-complete by 5.6. Much of the work is finished at this point, and we should be getting a more accurate picture of this feature in the coming months.

Global Styles

Screenshot of potential global styles toolkit for the Gutenberg WordPress plugin.
Example mockup from the primary global styles ticket.

A new global styles feature is set to ship for WordPress 5.6 later this year. The feature is currently undergoing heavy development. We should begin to see early iterations of it in upcoming versions of the Gutenberg plugin over the next several months.

Global styles will allow theme authors to create several default values, likely via a JSON file. In turn, users will be able to overwrite those styles through an interface in the admin.

My biggest concern about this feature is that it could go overboard with options that end-users should not have to concern themselves with. For example, most users should have no need to adjust the line-height for their text. Instead, line-height values should automatically be calculated based on a font’s x-height and size. The question is going to be where the global styles feature will draw the line. At a certain point, it is better to learn CSS. We certainly cannot expose every possibility via an option.

Other Notable Features

Lazy loading of images, which was originally planned for WordPress 5.4, will be shipping alongside a built-in XML sitemaps feature in version 5.5. Both features have been under active development for months and are stable at this point.

The navigation block was complete enough to ship in the previous WordPress release. The block is intended to primarily be used with full-site editing, so the block was not included. However, it is supposed to be available in WordPress 5.5.

As always, we should see a new default theme to propel us into the next year. My guess is that the core leads will want to ship a theme that is built completely on top of the upcoming full-site editing feature. If development goes as currently scheduled, Twenty Twenty-One could be a 100% block-based theme.

OpenText Launches OpenText Trading Grid

OpenText announced the launch of the new OpenText Trading Grid, a new cloud integration services platform. The launch combines multi-enterprise integration capabilities with a modern, microservices architecture as well as data visualization from OpenText ALLOY.  

Install pip command in Mint

I have to install the Django package to my mint distribution. I want to accomplish this by using pip command but can not find the pip command. How can I install the pip command ? Thanks

Styling in the Shadow DOM With CSS Shadow Parts 

Safari 13.1 just shipped support for CSS Shadow Parts. That means the ::part() selector is now supported in Chrome, Edge, Opera, Safari, and Firefox. We’ll see why it’s useful, but first a recap on shadow DOM encapsulation…

The benefits of shadow DOM encapsulation

I work at giffgaff where we have a wide variety of CSS code that has been written by many different people in many different ways over the years. Let’s consider how this might be problematic. 

Naming collisions

Naming collisions between classes can easily crop up in CSS. One developer might create a class name like .price. Another developer (or even the same one) might use the same class name, without knowing it.

CSS won’t alert you to any error here. Now, any HTML elements with this class will receive the styling intended for two completely different things.

Shadow DOM fixes this problem. CSS-in-JS libraries, like Emotion and styled-components, also solve this issue in a different way by generating random class names, like .bwzfXH. That certainly does help avoid conflicts! However, CSS-in-JS doesn’t prevent anybody from breaking your component in other ways. For example…

Base styles and CSS resets

Styles can be applied using HTML element selectors like <button> and <div>. These styles could break a component. Shadow DOM is the only thing that offers (almost) full encapsulation — you can rest assured that your component will look the same, even in a messy  !important  strewn codebase because each component is encapsulated.

/* This will have no effect on buttons inside shadow DOM */
button { background-color: lime !important; }

I wouldn’t say it’s good practice to style elements this way, but it happens. Even it does, those styles will have no effect on the shadow DOM.

It’s worth noting that inheritable styles like color, font and line-height are still inherited in a shadow DOM. To prevent that, use all: initial  or, preferably, all: revert once it has better browser support.

Let’s look at a common example of CSS applied directly to HTML elements. Consider this code from Eric Meyer’s reset

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

What if the component we’re working with makes use of the user agent’s default values for margin and padding? This reset might cause it to appear broken since those defaults are effectively wiped out.

Shadow DOM is a way to avoid these problems. Shadow DOM allows us to feel fully confident that a component will render as expected, regardless of what codebase it ends up in. Equally, none of the code meant only for a component can inadvertently affect anything else — all without resorting to onerous class naming conventions. Shadow DOM offers a level of encapsulation that can’t be achieved any other way.

Encapsulation is great, but we also want our components to be themeable and customizable. That’s been made far easier with the ::part selector. 

Styling shadow DOM with ::part()

Until now, the only way for CSS to modify the styling of a custom element from outside of the shadow DOM was to use CSS custom properties. In a strict design system where you only want to allow limited changes, that might be ideal. If you want your component to be more versatile, it creates a problem. Every CSS property you want to offer up for styling needs to be defined using a custom property. Just the sound of that seems tedious.

The situation is compounded further if we want to style a component differently based on pseudo-classes, like :hover. Basically, we end up with loads of custom properties. Let’s look at an example from Ionic, an open source set of web components. Just look at all the custom properties defined on the Ionic button component.

Go ahead, I’ll wait.

I counted 23 custom properties. Needless to say, that’s less than ideal.

Here’s an example using ::part() to style the element instead. 

In this Pen, I’m simply changing the color, border and background-color properties, but I could use whatever I want without being constrained by what custom properties have been defined. Notice that I can also style different states of the part using pseudo-classes, like :hover and :focus.

The entire component in this button example is being exposed for styling, but if your web component consists of multiple HTML elements, you can expose only selected parts of the component to this sort of styling — hence the name ::part. This stops users of the component from styling any arbitrary element inside the shadow tree. It is up the the component author to expose the parts of the component they explicitly want to. Other parts of the component can be kept visually uniform or make use of custom properties for a more minimal customizability. 

So, how do we set this up for our own components? Let’s look at using ::part to make certain elements of a web component eligible for styling. All we do is add a part attribute on the element we want to be exposed.

<div part="box">...</div>  
<button>Click me</button>

In this example the div is customizable with the full gamut of CSS — any CSS property can be changed. The button, however, is locked down — it cannot be visually changed by anybody except the component author.

And the same way an HTML element can have multiple classes, an element can have multiple part names: 

<div part="box thing">...</div>

So that’s what we get with ::part: by exposing “parts” of an element we can provide some flexibility in how a web component is used while exercising protection in other areas. Whether it’s your design system, a component library, or what have you, the fact that CSS Shadow Parts are becoming mainstream gives us yet another exciting tool to work with.

The post Styling in the Shadow DOM With CSS Shadow Parts  appeared first on CSS-Tricks.

How to Buy a Domain Name That is Taken (9 Pro Tips)

We often hear from readers who want to buy a domain name that’s already been taken.

If you’re in that position, then you might be wondering how to go about getting hold of a domain name that someone already owns.

The easiest solution would be to find another suitable domain name. However, sometimes this may not be the best option.

In this article, we’re going to share our expert tips on how to buy a taken domain and give you some insider tips on what to watch out for. We will also cover few proven strategies that you can use if your domain isn’t available.

Tips on buying a taken domain name

Note: Unlike other guides on the internet, this resource is based on our actual collective experience of buying premium domains. We have spent anywhere from few hundred to few million dollars in buying premium domains and established website businesses.

The Basics of Buying a Domain Name That’s Already Taken

All websites need a domain name. It is your website’s address on the internet. See our beginner’s guide on how domain names work if you’re not 100% sure what a domain name actually is.

You can register a new domain name for around $10 – $15 from any of the top domain registrars. Alternatively, you can even get a free domain name when you sign up with hosting companies like Bluehost, Dreamhost, etc.

But what if the domain name you want is already taken?

In that case, you have two options: come up with a different name or buy the one you really want from it’s current owner.

Buying a taken domain name from someone who’s already registered it could be a great move for your business.

However, it’s important to beware of risks and scams, so you don’t waste time or money. That’s why we have put together these tips on how to buy a taken domain as safely as possible.

What to Consider Before Buying a Domain Name

One key question to ask yourself is whether you want to purchase a domain name alone or an established website.

Buying a website, if it’s one that has a consistent track record of making money, can be a great shortcut. It lets you get a money-making business straight away rather than having to build one from scratch.

However, it’s going to be way more expensive to buy a website than just a domain name. You’ll also have more risks and legal liabilities to consider.

How to Actually Buy a Taken Domain Name

There are two main routes to buying domain names that are already taken:

  • Privately approaching the domain name’s owner and agreeing on the sale
  • Look for the name in domain marketplaces.

The first method avoids involving a third-party into the sale, and you may be able to persuade the owner towards more favorable pricing.

If the domain name already has a website with a contact form, then you can use that to reach out to the site owner.

Alternatively, you can search for it using the Domain WHOIS tool. You may be able to get the contact details of the owner from the domain details there.

The second method is to look for the name using online domain marketplaces. This is where many domain owners go to sell their domain names.

We recommend using Domain.com. It is one of the best places to register a domain name or buy a domain name for sale.

Simply search for the domain name you are looking for to see if it is available for sale.

Domain.com search

Domain names that are already taken may be highlighted as a premium domain name with a higher price. If you find the domain name listed there, then you can add it to the cart and proceed to payment.

You can try multiple domain marketplaces like Sedo, Flippa, etc to see if the domain is listed for sale there.

If the domain name is not listed anywhere, then it is probably not available for sale. You can still try the first method of approaching the owner with your offer.

That being said, let’s take a look at tips on making sure that you buy your domain name safely.

Tip 1. Avoid Using a Different Extension Instead

Domain name extensions

If you find that your domain name is taken when using a .com, then you might be tempted to use a different domain extension like .net or .org.

However, this can cause problems as people may forget your domain name and type in .com or .org.

You may even face legal issues if the .com owner argues that you’re trying to infringe on their brand name. This is particularly the case if they’ve registered it as a trademark.

We cover more on why you need a .com domain in our article on how to choose the best domain name.

Tip 2. Check the Domain Name isn’t a Registered Trademark

Trademark and copyright

If the domain name is a registered trademark of an existing business, then you could end up having to take your website offline completely in the future.

It’s well worth doing a quick search of the US trademark database to check whether your domain name is already being used by another company. You may also want to check local databases too.

Even a domain name that uses a trademark within it could be a problem. For instance, you can’t use the word “WordPress” in your domain name.

Tip 3. Don’t Get Too Emotionally Attached

Starting a new online business idea is exciting. Since your domain name plays a crucial role, it’s easy to get emotionally attached to a specific name.

However you need to be smart and rational about all financial investment decisions, including this one.

We recommend keeping your options open and look around for multiple domain names, or at least give them serious considerations.

This will help you in negotiation, so you can get the best deal without overpaying for your domain name.

Remember, the cost of premium domain names can vary from few hundred dollars to a few hundred thousand dollars.

Having options make sure that you don’t end up paying a huge sum of money for a domain name that’s really not any better than something else that was 1/10th of the price.

Tip 4. Check if a Website Has Ever Been Built There

Viewing the website history of a domain name using the WayBack machine

Make sure that you check website history using the Wayback Machine. It is possible that the domain name may have been used by someone else.

It is alright if the domain name has been used before, but you want to make sure that it wasn’t used for malicious, spammy, or illegal activities.

This may harm your business’ reputation and may even cause legal issues in the future. If there’s a Google penalty on the domain, then that could take a lot of work and resources to wipe out.

WayBack Machine is also a smart way of finding domain owner information as well.

Tip 5. Figure Out What the Domain is Worth

Domain valuation

Domain name pricing is tricky. If you’re new to buying domains, then you might wonder whether the price you’re being quoted is a bargain, a rip-off, or something in between.

Well, the truth is that there is no standard regulation for premium domain name pricing. Sellers independently decide the price, and it’s up to you as a buyer to decide if it’s worth the investment.

Premium domain names can range from few hundred dollars to a few hundred thousand dollars. Some rare premium domain names even go into the million dollar range.

If you’re new, then you can use a tool like EstiBot to get a general idea of what the domain may be worth.

Disclaimer: Automatic domain name evaluations aren’t necessarily very accurate, but they do show similar domain sales data which is helpful.

If the domain is priced too high (and it often will be), then you’ll need to be prepared to haggle. Don’t start by offering the maximum you’d be willing to consider. Instead, start at a lower price with the expectation that you’ll likely end up meeting half-way.

Keep in mind that there’s a limit to how low the seller will go. Don’t expect someone to accept $500 if they originally asked for $20,000.

However just because someone asked for $20,000 doesn’t mean you need to meet them half way either. We’ve often secured $20k domain deals in the $3k – $6k range.

Tip 6. Know Exactly What You’re Buying

Evaluate details

Make sure you know exactly what you’re going to be getting. Is it just the domain name you’re buying? Or are you buying a website too? If you’re buying the website, then does this include all the content?

Established websites may well use lots of different plugins and tools that the owner has licenses for. It’s unlikely that these licenses will be transferred over to you along with the sale, so you’ll need to be prepared to purchase them for yourself.

You’ll also want to be clear on whether you’re receiving assets like the website’s email list data.

If the domain name or website is a large purchase, then you should definitely have a lawyer draw up a contract for you. Consult someone who’s an expert in IP (Intellectual Property) law.

Even if you’re making a small purchase, be sure to get crucial details in writing at the very least.

Bonus: ask if the owner has access to existing social media accounts for the domain name, so you can get that as part of the deal.

Tip 7. Make Sure You’re Buying From the Domain’s Owner

Scam

Imagine this. You hand over your money for a domain name, only to find that the domain has been stolen. You never see your money again, and you’re not the legal owner of the domain either.

It’s a nightmare scenario, but unfortunately, it can happen. A good initial check is to use a tool such as DNS Trails to see whether there have been any recent changes to the DNS records. If you see something odd, then ask for an explanation.

If all your contact with the domain name owner has been through email, it’s well worth getting a phone number, so you actually talk to them. Email accounts can be hacked and email addresses can be faked.

Tip 8. Use Escrow to Transfer the Money

Escrow

You might be nervous about buying a domain name, particularly for a significant sum. What if the seller takes your money and doesn’t hand over the domain name?

The best solution is to use a site like Escrow.com. You give your money to the site, and they hold it securely until you confirm you’ve received the domain name. At that point, they hand the money to the seller.

Escrow.com has been used for the purchase of some hugely famous domain names, including Twitter.com, Gmail.com, WordPress.com and more. Note that you will need to pay a fee to Escrow.com.

Important: Don’t take a shortcut here and try to save on Escrow fees. We always use Escrow for domain purchases unless the domain owner is willing to transfer the domain to us before receiving payments. Trust us, it’s not worth the risk!

Tip 9. Consider Backordering a Domain You Want

Every day, thousands of domain names get expired and are not renewed or registered. A lot of businesses fail to take off or the domain owners lose interest.

In some cases, the owner might simply forget to re-register the domain.

You don’t have to watch the domain name to see when it’s about to expire. Instead, there are plenty of services that will monitor the domain name on your behalf. They’ll automatically try to register it the moment it’s available.

You can use GoDaddy for domain backorders. There are plenty of other sites that offer a similar service too.

The problem with back-ordering is that it may not work at all. The domain owner may renew their domain name, or someone else may have placed a backorder before you which will be given priority.

Final Thoughts + Alternative Strategies

Buying a domain name that’s already taken is not easy, and the process can take anywhere from few days to a few months. And if the owner doesn’t want to sell, then it can even take years to convince them.

This is why we always recommend having few options when you’re searching for domains. You can use a domain name generator like Nameboy to come up with ideas.

Here are some clever tips that can help you come up with alternatives:

  • Add a verb to your keyword – for example: getpocket.com, getcloudapp.com, and tryinteract.com
  • Extend your brand with a keyword – for example: invisionapp.com, gogoair.com, etc. Remember Tesla didn’t own tesla.com, so they started with TeslaMotors.com. Buffer didn’t own buffer.com, so they used bufferapp.com in the beginning.
  • Use abbreviations – for example: wpbeginner.com, wpforms.com, etc.
  • Use a catch phrase or adjective – for example: optinmonster.com, trustpulse.com, monsterinsights.com, etc.

We hope this article helped you learn how to buy a domain name that’s taken. You may also want to see our guide on proven ways to make money online, and our comparison of the best website builder platforms.

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 Buy a Domain Name That is Taken (9 Pro Tips) appeared first on WPBeginner.

Working From Home? 10 Cheap Ways To Set Up Your Home Office

Thanks to recent global events, scores of people around the world suddenly find themselves working from home – if they are lucky enough to be able to continue working at all. For newcomers to remote working, this can be a jolt to your lifestyle and pocketbook. Having to figure out how to set up a productive home office environment can be stressful and costly. But it doesn’t have to be.

In this post we are going to suggest some unconventional and creative ways to bring the cost of setting up your home office down by substituting more expensive home office supply necessities with less expensive solutions. By utilizing these ideas you can save a significant amount of stress and money and get your home office up and running quickly and affordably.

The Freelance Designer Toolbox

Unlimited Downloads: 500,000+ Web Templates, Icon Sets, Themes & Design Assets
All starting at only $16.50 per month


Laptop Stand

Do you dock your laptop in a stand where it’s closed and you use exterior monitors, keyboard and mouse? If so, you could easily find yourself paying at least $30-$60 for such an accessory. Why not use a paper towel holder that you can grab for only $9.99? Not only will it perform the same functionality, but it will look slick sitting on your home office desk.

Laptop Stand - Home Office

Monitor Stand

Fancy monitor stands will cost at least twice as much as using a fiberboard box such as this one. At only $15.81, you can raise your monitor up to eye level and also use it for storage at the same time.

Monitor Stand - Home Office

Pens, Mail, and Other Accessories Organizer

Keeping all of the loose items on your home office desk is not only important, it is necessary for your piece of mind and productivity. Rather than paying $25 or more, pick up a cutlery tray like this one to keep your accessories in, for less than $15!

Pens, Mail and other accessories - home office

 

Desk Pad

You can’t find a quality desk pad for under $20, so why not use kitchen shelf liners instead? You can cut them to your desired size, they are non-slip, they wipe clean easily, and they’re only $5.47.

Desk Pad - Home Office

Cell Phone and Tablet Stands

Here’s a cheap alternative to more expensive cell phone and tablet stands that will prop your smaller screens up for constant visibility on your desk. At $5.99 per pair, these can’t be beat!

Cell Phone and Tablet Stands - Home Office

Foot Rest/Stand

Ergonomic foot rests for underneath your home office desk can get crazy expensive, not to mention many of them are not the most pleasant to look at. While this recommendation is not repurposing something meant for another use, it’s a creative, fun, and unique way to give your feet a lift, and it’s only $10.99!

Foot Rest - Home Office

Desk Lamp

This is another desk necessity that is not repurposed, but for at least half the price of more decorative solutions this clip-on LED desk lamp is a steal at under $15!

Desk Lamp - Home Office

Cable Organizer

Substitute this kitchen utensil rest for more costly cord and cable organizers to clean up your desk area. Run your cables through the slots and enjoy inexpensive organization for only $6.

Cable Organizer - Home Office

Multi-Use Hanging Hooks

Use these clip on hooks as a way to organize cables underneath your desk or to hang other accessories you may have for easily reachable access. This easy organizational solution can be bought for only $6.29.

Multi-Use Hanging Hooks - Home Office

Utensil Holder

This bamboo organizer will add inexpensive yet stylish flair to your home office desk. At only $7.48, this is a great buy that will help keep your desk organized and writing and other utensils easily accessible.

Utensil Holder - Home Office

Do you have other creative home office solutions?

Hopefully our list has provided you with some creative ideas, and sparked you toward coming up with your own solutions that will make your personal working space unique and simultaneously affordable.

10 year member of daniweb

Hey all!

Hi again!! I am long time member (10 years) here. I have not logged in here since a long time. I see this site has changed a lot in a good way!

I used to visit to daniweb to learn about about new tech/coding using my dialup connection. This has been a uber cool place to hangout. :P

Any long time members? Just dropping to say hi! :)

Inspired Design Decisions With Herb Lubalin: Typography Can Be As Exciting As Illustration And Photography

Inspired Design Decisions With Herb Lubalin: Typography Can Be As Exciting As Illustration And Photography

Inspired Design Decisions With Herb Lubalin: Typography Can Be As Exciting As Illustration And Photography

Andrew Clarke

While good use of type helps people to read, great typography can do so much more. Typography can eloquently articulate an idea and colourfully communicate a message in ways which are as powerful as any illustration or photograph.

I’m someone who loves cinema as much as I admire typography. Few things inspire me as much as seeing movie poster typography which either evokes the atmosphere of a film and adds to the telling of its story.

From left: Pulp Fiction by Indika Entertainment Advertising. Once Upon a Time in Hollywood by BLT and Steve Chorney. Vertigo by Saul Bass. West Side Story by Joseph Caroff.
From left: Pulp Fiction by Indika Entertainment Advertising. Once Upon a Time in Hollywood by BLT and Steve Chorney. Vertigo by Saul Bass. West Side Story by Joseph Caroff. (Large preview)

More recently, typography in Quentin Tarantino’s film posters perfectly reflects the atmosphere and character of his movies. In Pulp Fiction, the title’s Aachen Bold typeface is as hardboiled as the film itself. For Once Upon a Time in Hollywood, although the typesetting of the iconic sign deviates from reality as much as other parts of the film, the poster conjures up the spirit of Hollywood.

Saul Bass is possibly the best-known graphic designer of his era and for 1950s and ’60’s Hollywood he created movie posters which are as recognisable as the sign itself. For his poster design for Hitchcock’s Vertigo in 1958, Bass used hand-cut typography which evokes German expressionist films of the 1920s. In 1960, Bass’s slashed title typography for Pyscho — again for Alfred Hitchcock — is both clever and obvious. While Saul Bass is often incorrectly credited with designing one of my favourite film posters from West Side Story, — Bass did design the title sequence — the poster was actually designed by Joseph Caroff who also created James Bond’s famous 007 logo.

Although we don’t yet have the same control over typography on the web as we do in print, new file formats, font delivery services, and web fonts have meant far more typographic flexibility than we had ten years ago. Typography controls in CSS have helped us be more creative with type too. On top of basic font style properties, we can now reliably fine-tune OpenType figures, hyphenation, ligatures, and even kerning.

It’s rare to find such creative uses for type online, studying the work of graphic designers and talented typographers can open our eyes to what we can achieve using today’s type technologies. One of my personal favourite designers and typographers is Herb Lubalin, and learning about him and his work has transformed my own approach to typography.

Read More From The Series

Inspired By Herb Lubalin

Herb Lubalin was an American graphic designer who spent his career designing everything from advertising, posters, and even postage stamps. He was fascinated by the look of words and how typographic design can make them sound. Lubalin understood how by combining art, copy, and typography, graphic designers add conviction when communicating messages. He said:

“The better people communicate, the greater will be the need for better typography-expressive typography.”

— Herb Lubalin

Having narrowly passed the entrance exam to the Cooper Union art school in New York, Herbert (Herb) Lubalin was fired from his first job as a graphic artist for asking for a $2 per week raise. In pre-war American advertising agencies, the job of a layout artist was simply to place headlines, copy, and images into available space, but that changed after WW2 with an influx of immigrant designers from Europe. They included Austrian Herbert Bayer, Russian Mehemed Fehmy Agha, and Belarusian Alexey Brodovitch.

U&lc (Uppercase and lowercase) magazine by Herb Lubalin. (Large preview)

These designers imported new processes which brought art directors, layout artists, and writers together to form the creative teams made popular by the famous advertising creative director Bill Bernbach in the 1960s and 1970s.

In 1945, Lubalin became art director at Sudler & Hennessey — a creative studio which specialised in the pharmaceutical industry — where he led a team of designers, illustrators, and photographers. The process which Lubalin established first at Sudler & Hennessey and from 1964 in his own studio is fascinating. He drove the design process by making “tissues” — pen and ink sketches which established the spacial arrangement of its elements — and detailed notes on typographic designs including typeface choices, sizes, and weights.

Fact magazine by Herb Lubalin. (Large preview)

At the start of any new project, Lubalin began by sketching arrangements of headlines, copy, and images onto tissue paper. Then, he’d lay another tissue on top to refine his ideas, then another, and another, to rapidly develop his design. After his assistants recovered discarded tissues from the floor or trash, they became collectors’ items.

Lubalin was an obsessive perfectionist about typography. For “Let’s talk type” — a trade advertisement for Sudler & Hennessey — Lubalin precisely placed the only paragraph. This copy sits perfectly on the baseline alongside the word “let” and its size and leading allow for the descender from the letter “y” above.

From left: Trade press advertisement. The fourth of July means picnics… Announcement of Avant Garde’s anti-war poster competition by Herb Lubalin. (Large preview)

Lubalin was equally as precise about the placement of text in a poster which announced the Avant Garde anti-war poster competition. He would frequently take a scalpel blade to type, adjusting the spacing between letters and altering the height of ascenders and descenders to fit his designs. Letters in the headline for “No More War” are precisely sized and aligned. The tracking of the uppercase blue standfirst creates a block of copy which perfectly fits into its space.

In “The fourth of July means picnics…” Lubalin used perspective to represent the road ahead. This meant considering the tracking of every line of text, sometimes altering words to fit the design. Working with Lubalin’s designs wasn’t easy, and as one of his assistants later described:

“To make everything line up, you’ve got to do it over and over again, and then, if the client alters the text, you’ve got to redo the whole thing. To him (Lubalin,) it was worth it. How long it took or how much it cost wasn’t as important to him as it was to other designers.”

Because of his relentless conviction as well as his talent, Lubalin went on to become one of the most celebrated graphic designers and typographers of the twentieth century. There’s plenty we can learn from how he approached his work and his conviction that design can compellingly communicate.

Various designs by Herb Lubalin. (Large preview)

There are two books on Herb Lubalin and his work you should add to your collection. “Herb Lubalin: Art Director, Graphic Designer and Typographer” (1985) by Gertrude Snyder and Alan Peckolick is out of print, but good copies are available on eBay. Better still is “Herb Lubalin: American Graphic Designer” (2013) by Adrian Shaughnessy and published by Unit Editions. A limited edition of 2000, Shaughnessy’s book features hundreds of examples of Lubalin’s work.

Pre-Formatting Headlines

Headlines are a perfect place to begin being more adventurous with type. Expressive typography needn’t need fancy fonts. You can create an eye-catching headline by using different styles and weights found within many everyday font families. Look for extended families like Montserrat — designed by Julieta Ulanovsky and available on Google Fonts — with its variety of weights ranging from thin and light, to extra-bold, and even black.

For this first Herb Lubalin inspired design, my headline uses black and light weights from this sans-serif typeface. Negative tracking (letter-spacing) and tight leading (line-height) combine to create a block of type which demands attention.

Black and light weights, negative tracking and tight leading. (Large preview)

In the past, developing headlines like this involved hard-coding the design into your HTML by adding breaks between individual words, like this:

<h1><strong>UK’s <br>
best-<br>
selling <br>
car</strong> <br>
during <br>
the <br>
1970s</h1>

Other times, you might use wrap each word with an inline span element and then change its display property to block:

<h1><strong><span>UK’s</span>
<span>best-</span>
<span>selling</span>
<span>car</span></strong>
<span>during</span>
<span>the</span>
<span>1970s</span></h1>

Instead of these presentational elements, I add explicit line breaks in my HTML:

<h1><strong>UK’s 
best-
selling
car</strong>
during
the
1970s</h1>

Browsers ignore anything more than a single space between words, so on small viewports, this headline reads like a sentence. I only need foundation styles which style its colours, size, and weights, as well as the negative tracking and tight leading which makes this headline distinctive:

h1 {
font-size: 6vmax;
font-weight: 300;
line-height: .75;
letter-spacing: -.05em;
text-transform: uppercase;
color: #fff; }

h1 strong {
font-weight: 600;
color: #bd1f3a; }

Whereas HTML’s pre element respects pre-formatted text and presents it exactly as written in a document, the CSS white-space property enables similar results without sacrificing semantics. Of the six available white-space values, these are the four I use these most often:

  1. white-space: normal;
    Text fills line-boxes and breaks as required
  2. white-space: nowrap;
    The text won’t wrap, and it may overflow its container
  3. white-space: pre;
    Explicit line-breaks are respected, text breaks with new lines and br elements
  4. white-space: pre-wrap;
    White-space is respected, but the text will also wrap to fill line-boxes

I only need the effects of the white-space property on larger viewports, so I isolate it with a media query:

@media (min-width: 64em) {

h1 {
white-space: pre; }
}

Using several styles from one font family adds visual interest. My Lubalin-inspired design incorporates light, bold, and black weights, plus condensed and regular styles of this sans-serif typeface to produce a variety of text-treatments.

Several paragraph styles from one font family adds visual interest. (Large preview)

First, I need two structural elements to accomplish my design, main and aside:

<main>…</main>
<aside>…</aside>

While the main element includes my headline and running text, the aside contains four images in a division and five articles about versions of the classic Cortina:

<aside>
<div>
<img src="img-1.svg" alt="Ford Cortina Mark 1 front profile">
<img src="img-2.svg" alt="Ford Cortina Mark 3 rear">
<img src="img-3.svg" alt="Ford Cortina Mark 4 front">
<img src="img-4.svg" alt="Ford Cortina Mark 5 rear profile">
</div>

<article>…</article>
<article>…</article>
<article>…</article>
<article>…</article>
<article>…</article>
</aside>

First, I specify the styles of paragraphs in each of my articles using pseudo-class selectors. Each paragraph uses a different combination of font styles and weights, with mixed-case and uppercase letters:

article:nth-of-type(1) p {
font-family: 'light';
text-transform: uppercase; }

article:nth-of-type(2) p {
font-family: 'bold-condensed';
font-weight: 600;
text-transform: uppercase; }

article:nth-of-type(3) p {
font-family: 'bold-condensed';
font-weight: 600; }

article:nth-of-type(4) p {
font-family: 'light';
text-transform: uppercase; }

article:nth-of-type(5) p {
font-family: 'bold-condensed';
font-weight: 600; }

With those foundation styles in place for every screen size, I introduce layout to the aside element which will be visible on for medium-size screens. For layouts like this, where elements don’t overlap, I often grid-template-areas for their simplicity. This design has nine grid areas. While I could give these areas names which describe the content I’ll place into them — for example, “mark-1” — instead I use letters which makes moving items around my grid a little easier:

@media (min-width: 48em) {

aside {
display: grid;
grid-template-areas: 
"a b c"
"d e f"
"g h i";
grid-gap: 1.5rem; }
}

I need to place the four images into my template areas, and not the division which contains them. I change the display property of that element to contents, which effectively removes it from the DOM for styling purposes:

aside div {
display: contents; }

I place those images using area names. Moving them into another area only involves referencing a different area name and no change to their order in my HTML:

aside img:nth-of-type(1) {
grid-area: a; }

aside img:nth-of-type(2) {
grid-area: e; }

aside img:nth-of-type(3) {
grid-area: g; }

aside img:nth-of-type(4) {
grid-area: i; }

Then, I place articles into the five remaining areas to complete my layout:

aside article:nth-of-type(1) {
grid-area: b; }

aside article:nth-of-type(2) {
grid-area: c; }

aside article:nth-of-type(3) {
grid-area: d; }

aside article:nth-of-type(4) {
grid-area: f; }

aside article:nth-of-type(5) {
grid-area: h; }

On small and medium-size screens, the main and aside elements stack vertically in the order they appear in my HTML. The extra space available in larger viewports allows me to place them side-by-side so visual weight is balanced across both sides of a screen. First, I apply a five-column symmetrical grid to the body element:

@media (min-width: 64em) {

body {
display: grid;
grid-template-columns: repeat(5, 1fr); }
}

Then, I place both main and aside elements using line numbers. This creates an asymmetrical design with a column of white space between my main content and the articles which support it:

main {
grid-column: 1; }

aside {
grid-column: 3 / -1; }
}

Reordering And Rotating

CSS Grid is now the best tool to use for implementing inspired layouts, and its powerful properties are also useful for developing intricate typographic designs.

Left: Castrated. Book jacket designed by Herb Lubalin. Right: Intricate header design developed using CSS Grid and Flexbox. (Large preview)

My header contains a headline followed by two paragraphs and their order in HTML means they make sense when read without any styling applied:

<header>
<h1>Cortina</h1>
<p>UK’s best-selling car</p>
<p>From <span>1962–1983</span></p>
</header>

To begin this design, I add foundation styles for both elements, setting their alignment, colours, and sizes:

header h1,
header p {
margin: 0;
text-align: center; }

header h1 {
font-size: 10vmax;
color: #ebc76a;
line-height: 1; }

header p {
font-size: 4vmax;
line-height: 1.1;
text-transform: uppercase; }

I ordered my HTML for a semantic sentence structure, rather than any visual presentation, so to allow me to reorder the elements visually, I add Flexbox properties to my header and a flex-direction value of column:

header {
display: flex;
flex-direction: column; }

By default, elements appear in the order they occur in HTML, but in my design, the last paragraph in this header appears first, above the headline.

The default order value for all elements is 0, so to change the position of this paragraph without altering my HTML, I add a negative value of -1, which places it at the top:

header p:last-of-type {
order: -1; }

My design for medium-size screens includes two large bands of background colours, developed using a CSS gradient. So next, I change the foreground colours of my headline and paragraphs to contrast them against this new background:

@media (min-width: 48em) {

body {
background-image: linear-gradient(to right, 
#0a0a08 0%, 
#0a0a08 50%, 
#fff 50%, 
#fff 100%); }

header h1 {
color: #fff; }

header p {
color: #ebc76a; }
}

The unusual alignment of the three elements in this header is possible by combining CSS Grid with Flexbox. Although it might not be obvious at first, I place the headline and paragraphs in this header onto a four-column symmetrical grid. Leaving one column in the first and last rows empty creates a dynamic diagonal which adds interest to this header:

@media (min-width: 64em) {

header {
display: grid;
grid-template-columns: repeat(4, 1fr);
align-items: start;
padding-top: 0; }
}
A dynamic diagonal which adds interest to this header. (Large preview)

My headline spreads across all four columns:

header h1 {
grid-column: 1 / -1; }

While the first — which appears at the bottom of my header — leave the first column empty:

header p:first-of-type {
grid-column: 2 / -1; }

The final paragraph—now placed at the top of the header — spans the first three columns, leaving a space on the left:

header p:last-of-type {
grid-column: 1 / 4; }

It’s unusual to see rotated text elements on the web, but when you do, they’re often memorable and always a nice a surprise. I want my headline rotated anti-clockwise, so I add a transform which rotates it negatively by 30 degrees and moves it vertically down by 150px:

header {
transform: rotate(-30deg) translateY(150px);
transform-origin: 0 100%; }

transform-origin specifies the point around which transforms happen. You can choose an origin in the centre or any of the four corners of an element — top-left (0 0), top-right (100% 0), bottom-right (100% 100%) or bottom-left (0 100%). You might also specify an origin in pixels, em, or rem units.

The results of 50% 50%, 0 0, 100% 0, 100% 100%, and 0 100% transform-origin values. (Large preview)

For an extra element of surprise, I add a subtle transition to that transform and reduce the amount of rotation when someone passes their cursor over my headline:

header {
transition: transform .5s ease-in; }

header:hover {
transform: rotate(-25deg) translateY(150px); }
CSS Grid is now the best tool to use for implementing inspired layouts. (Large preview)

Combining Header Elements

Left: Graphis Annual Report. Center: American Showcase references USA flag. Right: My design references the United Kingdom’s Union flag. (Large preview)

In my next Lubalin-inspired design, I combine an ordered list of Cortina models with a multi-coloured headline to make a powerful statement with this header:

<header>
<div>
<h1>…</h1>
<ol>…</ol>
</div>
</header>

This headline includes three lines of text. Whereas I previously avoided using additional elements, to style these lines differently I need three inline span elements:

<h1>
<span>Best</span>
<span>Selling</span>
<span>Cortina</span>
</h1>

The most semantic choice to mark up my list of Cortina models and the years during which they were manufactured, is an ordered list. To strongly emphasise each model name, I enclose them within strong elements, which deliver semantic value as well as a bold appearance from default browser styles:

<ol>
<li><strong>Mark I</strong> 1962–1966</li>
<li><strong>Mark II</strong> 1966–1970</li>
<li><strong>Mark III</strong> 1970–1976</li>
<li><strong>Mark IV</strong> 1976–1979</li>
<li><strong>Mark V</strong> 1979–1983</li>
</ol>

For small viewports, I need only a few foundation styles. The large font size and minimal leading create a solid block of text. Then, I change the span element’s display value from inline to block and use pseudo-class selectors to change the foreground colours of the first and third lines:

h1 {
font-size: 18vmin;
line-height: .9;
color: #fff; }

h1 span {
display: block; }

h1 span:nth-of-type(1) {
color: #ba0e37; }

h1 span:nth-of-type(3) {
color: #31609e; }

I want items in my ordered list to form a two-column symmetrical grid where each column occupies an equal amount of available space:

ol {
list-style-type: none;
display: grid;
grid-template-columns: 1fr 1fr; }

Then, I tighten the items’ leading and add a solid blue border to the bottom of all but the last list-item:

li {
display: inline-block;
line-height: 1.2; }

li:not(:last-of-type) {
border-bottom: 1px solid #31609e; }

Conveniently, there’s no need to specify column or row numbers for each list-item because CSS Grid arranges them automatically because of normal flow. To add greater emphasis, I change the strong elements’ display values to block and set them in uppercase:

li strong {
display: block;
font-size: 1.266rem;
font-weight: 600;
text-transform: uppercase; }
A multi-coloured headline combined with an ordered list of Cortina models. (Large preview)

Centring an element both horizontally and vertically used to be tricky, but thankfully, Flexbox has made this alignment trivial to implement. Flexbox has two axes — main axis and cross axis — which change direction if you change the default flex-direction value from a row.

The flex-direction of my header remains row, so I align-items centre on the cross axis (vertical,) then justify-content centre along the main axis (horizontal:)

@media (min-width: 48em) {

header {
display: flex;
align-items: center;
justify-content: center; }
}

With content now entered in the header, I apply a grid which contains three columns and two rows. Their dimensions will be defined by their content and will resize automatically:

header > div {
display: grid; 
grid-template-columns: repeat(3, min-content);
grid-template-rows: auto auto; }

The three multi-coloured lines in the headline are the foundation for this header design. I want to place them into specific columns and rows in this grid, so I add display: contents; to the headline:

h1 {
display: contents; }

Then, I place that multi-coloured text into columns and rows using line numbers:

h1 span:nth-of-type(1) {
grid-column: 1;
grid-row: 2; }

h1 span:nth-of-type(2) {
grid-column: 2;
grid-row: 1 / 3; }

h1 span:nth-of-type(3) {
grid-column: 3;
grid-row: 1 / 3; }

I want the text in my header to appear vertical, so I rotate each span clockwise by 180 degrees, then change their writing-mode to vertical left–right:

h1 span {
transform: rotate(180deg); 
writing-mode: vertical-lr; }

The headline and ordered list in my design form a solid block. To pack these elements tightly together, I change the list’s display property from grid to block. Then, I align content in each list-item to the right, so they sit on my headline’s baseline:

ol {
display: block; }

li {
text-align: right; }

SVG And Text

It’s taken me a long time to appreciate SVG and to become familiar with how to get the best value from it, and I’m still learning. SVG is capable of producing far more than basic shapes, and one of its most exciting features is the text element.

Like HTML text, SVG text is accessible and selectable. It’s also infinitely styleable by using clipping paths, fills including gradients, filters, masks, and strokes. Adding text to SVG is just like including it in HTML, using the text element. Only content inside these text elements is rendered by browsers, and they ignore anything outside them. You can add as many text elements as you need, but my next headline needs only one:

<svg>
<text>’70’s best-selling Cortina British car</text>
</svg>

SVG includes a set of properties and attribute values which can be applied to text. Many SVG properties — like letter and word spacing, and text-decoration — are also in CSS. But it’s styling features unique to SVG which help to make SVG text so appealing.

For example, textLength sets the width of rendered text, which will shrink and stretch to fill the space depending on the lengthAdjust value you choose.

  • textLength
    The text will be scaled to fit. Set textLength in percentages or use any numerical values. I prefer to use text-based units, em or rem.
  • lengthAdjust
    Defines how the text will be compressed or stretched to fit the width defined in the textLength attribute.

When used directly on a text element, SVG properties act the same as inline styles:

<svg>
<text textLength="400">’70’s best-selling Cortina British car</text>
</svg>

But just as with inline styles, the best value is achieved by styling SVG elements using CSS, whether in an external stylesheet or embedded in HTML. You can even use a style element in an external SVG file or a block of SVG included alongside HTML:

<svg>
<text class="display">’70’s best-selling Cortina British car</text>
</svg>

<style>
.display {
font-size: 100px;
font-family: 'black-extended';
font-weight: 600;
letter-spacing: -1px;
text-anchor: middle;
text-transform: uppercase; }
</style>

HTML has its span element and SVG includes a similar element which is useful for separating text into smaller elements so they can be styled uniquely. For this headline, I divide the content of the text element between six tspan elements:

<text>
<tspan>’70’s</tspan>
<tspan>best-</tspan>
<tspan>selling</tspan>
<tspan>Cortina</tspan>
<tspan>British</tspan>
<tspan>car</tspan>
</text>

By splitting my headline into multiple elements, I’m able to style each individual word. I can even position them precisely within my SVG, according to the baseline or even relative to each other.

  • x is the horizontal starting point for the text baseline;
  • y is the vertical starting point for the text baseline;
  • dx shifts text horizontally from a previous element;
  • dy shifts text vertically from an earlier element.
(Large preview)

For my headline, I position the first tspan element 80px from the top, then each subsequent element appears 80px below it:

<text>
<tspan y="80">’70’s</tspan>
<tspan dy="80">best-</tspan>
<tspan dy="80">selling</tspan>
<tspan dy="80">Cortina</tspan>
<tspan dy="80">British</tspan>
<tspan dy="80">car</tspan>
</text>

tspan elements are useful for precise positioning and individual styling, but they’re not without accessibility concerns. Assistive technology pronounce tspan elements as individual words and even spell them when a tspan wraps a single letter. For example, a screen reader will pronounce this series of tspan elements:

<tspan>C</tspan>
<tspan>o</tspan>
<tspan>r</tspan>
<tspan>t</tspan>
<tspan>i</tspan>
<tspan>n</tspan>
<tspan>a</tspan>

As:

“C”, “o”, “r”, “t”, “i”, “n”, “a”

We shouldn’t inconvenience people who use assistive technology or worse make our content inaccessible because of our styling choices. So avoid using tspan unnecessary and never for single letters.

Stroking Text With CSS And SVG

Adding a stroke often helps legibility when text is placed in front of a background image, and it can also make subtle and striking results. You won’t find an official way to stroke text in any CSS specification. But there is an experimental property which uses a Webkit vendor prefix and is widely supported by contemporary browsers.

(Large preview)

text-stroke is shorthand for two properties: text-stroke-color and text-stroke-width. For my stroked headline, I first set foundation typography styles for family, size, and weight, then adjust the leading and tracking:

h1 {
font-size: 100px;
font-family: 'black-extended';
font-weight: 600;
letter-spacing: -6px;
line-height: .8;
color: #fff; }

Then I apply text-stroke and add the text-fill-color property with a value of transparent which overrides the white foreground colour:

h1 {
/* -webkit-text-stroke-color: #fff; */
/* -webkit-text-stroke-width: 5px; */
-webkit-text-stroke: 5px #fff;
-webkit-text-fill-color: transparent; }

Although text-stroke is an experimental property and not in a W3C specification, now that browsers have implemented it, there’s little chance of it being removed. But if you’re still concerned about supporting a legacy browser, consider using a feature query to test for text-stroke support and provide an appropriate fallback for them.

SVG has stroke properties too, plus a few options which aren’t available in CSS. If you need more options and the widest browser support, SVG is the answer. My SVG header includes six tspan elements:

<svg>
<text>
<tspan>’70’s</tspan>
<tspan>best-</tspan>
<tspan>selling</tspan>
<tspan>Cortina</tspan>
<tspan>British</tspan>
<tspan>car</tspan>
</text>
</svg>

On top of foundation typography styles, I add the equivalent SVG properties for text-stroke-color and text-stroke-width. I also reduce the opacity of my stroke, which is an option unavailable in CSS:

text {
stroke: #fff;
stroke-width: 1.5px;
stroke-opacity=".8"; }
SVG stroke-dasharray adds a border style not possible using CSS alone. (Large preview)

SVG includes other properties which fine-tune aspects of a stroke. Unlike CSS, SVG strokes can be dashed using the stroke-dasharray property. Alternate values define filled areas and blank areas, so the dashes around my headline text are one unit filled, then ten units blank:

text {
stroke-dasharray: 1, 10; }

Should you need more complex patterns, add extra numbers to the pattern, so a stroke-dasharray value of 1, 10, 1 results in a dashed stroke which is 1 (filled,) 10 (blank,) 1 (filled,) 1 (blank,) 10 (filled,) 1 (blank,) and repeats.

My large-screen design, inspired by Herb Lubalin. (Large preview)
stroke-linecap defines how ends of lines appear in SVG. Left: butt. Middle: round. Right: square. (Large preview)
stroke-linejoin defines how lines join in SVG. Left: bevel. Middle: round. Right: miter. (Large preview)

Optimize SVG Accessibility

CSS typography controls are now more powerful than ever, but there are occasions when a design calls for more than styled HTML text. Image replacement techniques have fallen out of fashion, but SVG — whether in an external file or inline within HTML — can deliver scalable text effects. SVG can also be useful for overall performance when optimised well and can be made accessible.

This header contains two typefaces. One is Magehand, a decorative retro-style script by Indonesian type designer Arief Setyo Wahyudi. The other is Mokoko, a slab serif by London-based Dalton Maag which is available in seven weights from thin to black.

Embedding these two fonts in both Web Open Font Format (WOFF) and WOFF2 formats would add over 150kb to my page. Whereas, by converting these fonts to outlines in a graphics editor and delivering the header as an optimised SVG image would add only 17kb.

The SVG image in my header contains three paths:

<svg xmlns="http://www.w3.org/2000/svg">
<path id="top">…</path>
<path id="bottom">…</path>
<path id="middle">…</path>
</svg>
(Large preview)

The order of these paths matters, because just as in HTML, elements are stacked in the order they’re written. SVG includes a set of properties and attribute values which can be applied to any element. I use the fill property to colour each path in my header:

<path fill="#bd1f3a">…</path>
<path fill="#31609e">…</path>
<path fill="#fff">…</path>

For an even more stylish effect, I can define a linear gradient with two colour stops, and reference that to fill my decorative script:

<defs>
<linearGradient id="cortina" gradientTransform="rotate(90)">
<stop offset="0%"  stop-color="#bd1f3a" />
<stop offset="100%" stop-color="#31609e" />
</linearGradient>
</defs>

<path fill="#fff">…</path>
<path fill="#fff">…</path>
<path fill="url('#cortina')">…</path>

SVG files are frequently smaller than bitmap images or the combined size of several font files, but they nevertheless need careful optimisation to achieve the best performance.

Every element, handle, and node increases the size of an SVG file, so replace paths with basic shapes like circles, ellipses, or rectangles where possible. Simplify curves to reduce the number of nodes and use fewer handles. Popular graphic software like Adobe Illustrator, Affinity Designer, and Sketch export files bloated by unoptimised elements and unnecessary metadata. But, tools like SVGOMG by developer Jake Archibald will strip away unneeded items and can often reduce SVG file size substantially.

SVG images which contain text outlines can also be made accessible by using alternative text and ARIA properties. When linking to an external SVG file, add alternative text as you should with any non-decorative image:

<img src="header.svg" 
alt="Cortina. ’70s best-selling British car">

The best way to help people who use assistive technology is to embed SVG into HTML. Add an ARIA role and a descriptive label and screen readers will treat the SVG as a single element and read the label description aloud:

<svg role="img" aria-label="Cortina. ’70s best-selling British car">
…
</svg>

Adding a title element helps assistive technology to understand the difference between several blocks of SVG, but this title won’t be displayed in a browser:

<svg>
<title>Cortina. ’70s best-selling british car</title>
</svg>

When there are several blocks of SVG in a document, give each one a unique ID and add that to its title:

<svg>
<title id="header">…</title>
</svg>

ARIA has several attributes which help SVG accessibility. When SVG is purely decorative and has no semantic value, hide it from assistive technology by adding an aria-hidden attribute:

<svg aria-hidden="true">
…
</svg>

For my design, I use SVG in place of an HTML heading. To replace the missing semantics for assistive technology, use an ARIA role attribute and a value of heading. Then add a level attribute which matches the missing HTML:

<svg role="heading" aria-level="1">
…
</svg>

Clipping Type

The CSS background-clip property defines whether an element’s background extends underneath its border-box, padding-box, or content-box, according to the CSS box model:

  • border-box
    Background extends to the outside edge of the border (and underneath the border).
  • padding-box
    Background extends to the outside edge of the padding only.
  • content-box
    The background is rendered within (clipped to) the content box only.
background-clip. Left: border-box. Middle: padding-box. Right: content-box. (Large preview)

But, there’s one more value which offers many more opportunities for inspiring typography. Using text as a value for background-clip clips an element’s background to the space occupied by the text it contains.

Left: Anti-war poster for American Institute of Graphic Arts exhibition. Designed by Herb Lubalin. Right: The background-clip text value clips an element’s background to the space occupied by the text it contains. (Large preview)

In my next example, the brake disk background image is visible only where there’s text in the headline. When my headline includes more content or its text size increases, more of that background image will be visible:

h1 {
background-image: url(pattern.svg);
background-clip: text;
-webkit-background-clip: text;
color: transparent; }

You can apply the text value for background-clip to any element except the :root, HTML. As support forbackground-clip is limited, I use a feature query which delivers those styles only to supporting browsers:

h1 {
color: #fff; }

@supports (background-clip: text) or (-webkit-background-clip: text) {
h1 {
background-color: #fff;
background-image: url(pattern.svg);
background-position: 50% 100%;
background-repeat: no-repeat;
background-size: 50%;
background-clip: text;
-webkit-background-clip: text;
color: transparent; }
}

Inspired by Lubalin, I want to place images inside the letters of my next headline, and the SVG image element allows me to do just that.

Left: Trade press advertisement designed by Herb Lubalin. Right: Images inside each letter of my SVG headline. (Large preview)

As this SVG image represents a heading, I add alternative text plus an ARIA role and level to ensure it remains accessible:

<img src="header.svg" alt="Cortina" 
role="heading" aria-level="1">

In SVG, the defs element stores graphical objects which can be referenced from elsewhere in a file. These include the patterns which contain my images and I add one for each letter:

<svg>
<defs>
<pattern id="letter-c">…</pattern>
<pattern id="letter-o">…</pattern>
<pattern id="letter-r">…</pattern>
…
</defs>
…
</svg>

Content in the defs element is not rendered directly and to display it I reference them with either a use attribute or url. My SVG contains one path for each of the seven letters in the word “Cortina,” and I fill each path with a pattern using its unique ID:

<svg>
<defs>…</defs>
<path fill="url(#letter-c)">…</path>
<path fill="url(#letter-o)">…</path>
<path fill="url(#letter-r)">…</path>
…
</svg>
Images inside each letter of my SVG headline. (Large preview)

Image elements allow either bitmap or vector images to be rendered within an SVG. My design incorporates three car part blueprint images which I link to using a standard href attribute:

<defs>
<pattern id="letter-c" width="100%" height="100%">
<image href="pattern-c.png" height="250" width="250"/>
</pattern>
…
</defs>

These three car part pattern images fill each letter, and the result is a striking headline design which demands attention.

Combining Techniques

There’s no doubt that Herb Lubin had a masterful ability to make type talk. For this final Lubin-inspired example, I put together the techniques I’ve demonstrated to create a compelling design for this classic ’70s Ford.

Left: Trade press advertisement designed by Herb Lubalin. Right: Main content placed over a text-based SVG background image. (Large preview)

To develop this design, I need two structural elements which should be very familiar by now, a main and aside:

<main>…</main>
<aside>…</aside>

My main element contains a header element with an SVG headline followed by a division which includes my running text. I add an ARIA role and level to my headline to ensure its SVG text is accessible:

<main>

<header>
<svg role="heading" aria-level="1">…</svg>
</header>

<div>…</div>

</main>

To serve a full image to small screens and half to larger viewports, I use a picture element and a minimum width media query:

<aside>
<picture>
<source srcset="half.svg" media="(min-width: 74em)">
<img src="full.svg" alt="Ford Cortina">
</picture>
</aside>

Lubalin’s designs are often energetic, so to fill my main element with energy, I apply grid properties and use three columns and five rows to develop an asymmetrical layout.

main {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: repeat(5, 1fr); }

This design is dominated by an outline of the charismatic Cortina, and a text-based background image which covers the main element. I scale this SVG to fill the element’s background, and change the background-origin so it appears only behind the content and not its border or padding:

main {
background-image: url(main.svg);
background-origin: content-box;
background-position: top right;
background-repeat: no-repeat;
background-size: 100% 100%; }

Leaving columns around my header and text division empty creates negative space which helps to lead someone’s eye around the composition. The header occupies the first two of my three columns while the division fills the last two:

header {
grid-column: 1 / 3;
grid-row: 2 / 3; }

main div {
grid-column: 2 / 4;
grid-row: 3 / 6; }

One of the benefits of using the SVG text element is the ability to position text according to its baseline or relative to each elements. My headline SVG includes two text elements for the name of this car, and a third for the period it was manufactured. I want to place this final text element precisely 250px from the left and 60px from the top of my SVG:

<svg>
<text x="0" y="60">Ford</text>
<text x="0" dy="70">Cortina</text>
<text x="250" y="60">1962–1983</text>
</svg>
Left: My large-screen design, inspired by Herb Lubalin. Right: To serve a full Cortina image to small screens and only the right half to larger viewports, I use a picture element. (Large preview)

This dazzling design becomes more memorable on larger viewports when the text-based SVG background image and my Cortina outline fit alongside each other. I apply a two-column symmetrical grid to the body element:

@media (min-width: 74em) {

body {
display: grid;
grid-template-columns: [main] 1fr [aside] 1fr; }
}

Then, I place the main and aside elements onto my grid using line names:

main {
grid-column: main; }

aside {
grid-column: aside; }
}

On the web, inspiring typography should be attractive and readable, but the readability of running text can easily be affected by the background behind it.

The backdrop-filter applies CSS filter effects to elements behind the text. These filters include blur, brightness and contrast, and colour effects which can all help to make the running text more readable against either background images, graphics, or patterns.

Apply one or multiple filters using the same CSS filter syntax I demonstrated in a previous issue:

main {
backdrop-filter: brightness(25%); }

main {
backdrop-filter: brightness(25%) contrast(50%); }

backdrop-filter is part of the Filter Effects Module Level 2 specification. It already has solid support in contemporary browsers, although some still require the Webkit vendor prefix:

main div {
-webkit-backdrop-filter: blur(3px);
backdrop-filter: blur(3px); }

NB: Smashing members have access to a beautifully designed PDF of Andy’s Inspired Design Decisions magazine and full code examples from this article. You can also buy the PDF and examples from this along with every other issue from Andy’s website.

Read More From The Series

Smashing Editorial (vf, ra, yk, il)

Python – Keyboard module – Threading problem

Hi everyone,
I am working on an app and trying to create a corrector and I am using keyboard module for the correction.
I have created a class, which reads pressed events and displays them to screen, and its action are dependent to a variable passed to the constructor.
If the user input then the suppress part is executed, but when not the other part is executed.
What I want to achieve is while the app corrects user input, every text that is typed by the user is suppressed and saved in a variable, for later use.
I have managed to make it work in paralell, but having some problems.
Please see the code below.

import keyboard
import threading
import time

lock_for_listening_to_keyboard = threading.Lock()
global running_suppressed_monitor 
running_suppressed_monitor = False

#########################################################
def delete_and_write(times_to_delete, word_to_write):
    global running_suppress_monitor
    print("---Deleting & Rewrite Started---")
    time.sleep(2)
    running_suppressed_monitor = False
    print("---Deleting & Rewrite Ended---")
    # for i in range(times_to_delete+1):
    #     keyboard.press_and_release('backspace')

    # for i,char in enumerate(word_to_write):
    #     keyboard.write(char.upper())

    # keyboard.write(' ')   

def write_the_suppressed_string(string):
    keyboard.write(string)
#########################################################

class keyboard_monitor(threading.Thread):
    def __init__(self,thread_name, threadID, word_typed,  keyboard_suppress, counter_for_key_pressed):
        threading.Thread.__init__(self)
        self.name = thread_name
        self.threaID = threadID
        self.fstring = word_typed
        self.counter_for_key_presses = counter_for_key_pressed
        self.suppressed = keyboard_suppress
        self.temp = ""

    def stop(self):
        self._is_running = False

    def run(self):

        if (self.suppressed is False):

            while(True):

                event = keyboard.read_event(suppress = self.suppressed)

                if (event.event_type == keyboard.KEY_DOWN):

                    if (event.name == "space"):

                        suppressed_monitor = keyboard_monitor("suppressed_monitor", 2, self.fstring, True, self.counter_for_key_presses)
                        suppressed_monitor.start()
                        suppressed_monitor.join()

                        print("RETURNED TO MAIN MONITOR")
                        self.counter_for_key_presses = 0
                        self.fstring = ""
                    elif (event.name in "abcdefghijklmnopqrstuvwxyz"):
                        self.fstring = ''.join([self.fstring, event.name])
                        self.counter_for_key_presses += 1

        elif (self.suppressed is True):

            self.temp = self.fstring
            self.fstring = ""
            thread_delete_and_rewrite = threading.Thread(
                target = delete_and_write, args=(self.counter_for_key_presses, self.temp))
            thread_delete_and_rewrite.start()

            running_suppressed_monitor = True
            # while(thread_delete_and_rewrite.is_alive()):
            while(running_suppressed_monitor):

                event = keyboard.read_event(suppress=self.suppressed)

                if (event.event_type == keyboard.KEY_DOWN):
                    print("KEYS PRESSED WHILE SUPPRESSED = {}".format(event.name))
                    if (event.name == "space"):
                        self.temp = self.fstring
                        self.fstring = ""
                        thread_delete_and_rewrite = threading.Thread(
                                target = delete_and_write, args=(self.counter_for_key_presses, self.temp))
                        thread_delete_and_rewrite.start()
                        # thread_delete_and_rewrite.join()
                        self.counter_for_key_presses = 0
                        self.fstring = ""
                    elif (event.name in "abcdefghijklmnopqrstuvwxyz"):
                        self.fstring = ''.join([self.fstring, event.name])
                        self.counter_for_key_presses += 1
                    # NO thread_delete_and_rewrite.join()
                # NO thread_delete_and_rewrite.join()

                if (thread_delete_and_rewrite.is_alive() is False):
                    break

            thread_delete_and_rewrite.join()
            print("SELF.FSTRING = {}".format(self.fstring))

            print("BEFORE END OF SUPPRESSED MONITOR")

            if (self.fstring != ""):
                thread_write = threading.Thread(
                                target = write_the_suppressed_string, args=(self.fstring, ))
                thread_write.start()
                thread_write.join()
            print("SUPPRESSED ENDED")
            self._is_running = False

if __name__ == "__main__":
    kb_not_suppressed = keyboard_monitor("not_suppressed_monitor", 1, "", False, 0)
    kb_not_suppressed.start()
    kb_not_suppressed.join()

I am trying to return the control when the function of correction is done, but can't find the correct way
(what I want is the second while loop to end when the correct and rewrite is done, now it ends when the correct and rewrite is done and a button is pressed ).
Any help is appreciated.