Remove link
article thumbnail

Next.js Wildcard Subdomains

Smashing Magazine

In code, that looks like this: export async function getServerSideProps(context) { let wildcard = context.req.headers.host.split(".")[0]; Here’s how that code looks like: // useEffect and useState must be imported from 'react' const [wildcard, setWildcard] = useState("") useEffect(() => { setWildcard(window.location.hostname.split(".")[0])

Servers 84
article thumbnail

Creating A Magento PWA: Customizing Themes vs. Coding From Scratch

Smashing Magazine

Creating A Magento PWA: Customizing Themes vs. Coding From Scratch. Creating A Magento PWA: Customizing Themes vs. Coding From Scratch. One of the reasons for that is because a PWA has the same code base. So unlike the case with native applications, the progressive web app needs to be coded only once. Alex Husar.

Code 74
Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Trending Sources

article thumbnail

Gone Floating Labels And Green Lighthouse Scores

Smashing Magazine

Also, if you have released an open-source tool and would love to draw more attention to it, please let us know as well and we’d love to have you presenting your project here in the magazine as well. Workflow & Code. Workflow, Code. Workflow, Code. Workflow, Code. Workflow, Code. Workflow, Code.

Mobile 140
article thumbnail

Localizing Your Next.js App

Smashing Magazine

Create valid ones using locale code and/or country codes and stick with lower-case because they will generate a url soon. If you want to navigate to a specific locale, we must provide a locale prop to our Link component, otherwise, it will fall back based on the browser’s Accept-Language header. <Link Your Next.js

article thumbnail

Refactoring CSS: Strategy, Regression Testing And Maintenance (Part 2)

Smashing Magazine

Refactoring CSS: Strategy, Regression Testing And Maintenance (Part 2). Refactoring CSS: Strategy, Regression Testing And Maintenance (Part 2). In this article, we’ll take a deep dive into the refactoring process itself, and cover incremental refactoring strategy, visual regression testing, and maintaining the refactored codebase.

Strategy 132
article thumbnail

Interactive Learning Tools For Front-End Developers

Smashing Magazine

Over the last little while, I’ve been able to collect links to several interactive coding tools and apps that can help you supplement your skills in different areas of web development. This is a straightforward flexbox playground that also generates the code for you. “code golf”). Louis Lazaris.

article thumbnail

A Simple But Effective Mental Health Routine For Programmers

Smashing Magazine

After working on a coding project for a good couple of hours, many developers like myself tend to hit a wall. For the most part, coding can be quite intimidating and disappointing for a beginner or even a well-versed developer. It helps bring down the high levels of the Cortisol hormone that is linked to stress. Dave Oscar.