Hopp til hovedinnhold

Innhold om Frontend

Totalt 322 innlegg

Side 5 av 22

3 enkle ting som gjør nettsiden din mer miljøvennlig

Frontend
Artikkel (4 min)
Fra Hans Kristian Henriksen
07.12.2023

Pakk inn elementene dine med box-shadow istedenfor border

Frontend
Artikkel (5 min)
Fra Marcus Haaland
05.12.2023

Julen står for døren, men det er ikke bare gaver vi pakker inn. I årevis har kanskje ditt verktøyvalg for å pakke inn elementer falt på border. Men hva om jeg fortalte deg at det finnes en mer fleksibel og layout-vennlig egenskap enn dette? Denne guiden vil utforske hvordan box-shadow kan brukes som et alternativ til tradisjonelle borders, og hvordan dette kan hjelpe oss å unngå layout-problemer.

Wrap your elements with box-shadow instead of border

Frontend
Artikkel (6 min)
Fra Marcus Haaland
05.12.2023

Christmas is at the door, but not only presents are being wrapped. For years your tool of choice for wrapping elements has been border. But what if I told you there exists an even more flexible and layout friendly property than this? In this guide we will explore how box-shadow can be used as an alternative to traditional borders, and how it can solve our layout problems.

Help Google Help You - Dynamic Sitemaps with Remix and Sanity

Frontend
Artikkel (4 min)
Fra Tor Martin Frøberg Wang
05.12.2023

This guide outlines the steps needed to inform Google of each new page in your Sanity CMS and dynamically boost your site's visibility and ranking in the search results.

Break your app into pieces: Code splitting and lazy loading without the tears

Frontend
Artikkel (10 min)
Fra Andreas Hammer Håversen
04.12.2023

Code splitting and lazy loading can be synonymous with heartache and headache. Luckily, smart people have made tools to make it easier for us. Webpack and React Router are familiar to many in the React community. Add loadable-components to the mix, and you have all the ingredients for code splitting and lazy loading without the tears!

Polymorfisme i React: 2 mønstre du må kjenne til

Frontend
Artikkel (6 min)
Fra Marcus Haaland
01.12.2023

Enten du lager et bibliotek eller lager React-komponenter for din egen del, er det en teknikk du bør kjenne til: polymorfisme. Det er når én ting kan ta flere former, som når en knapp kan opptre som en lenke. Brukt riktig, kan det redde deg fra å vedlikeholde ulike varianter, samtidig som det kan gi brukerne fleksibiliteten de trenger fra komponenten. I denne teksten vil jeg vise deg hvordan du kan utnytte 2 av de mest kjente måtene å få til polymorfisme i React: “as”- og “asChild”- mønstrene.

Polymorphism in React: 2 patterns you must know

Frontend
Artikkel (7 min)
Fra Marcus Haaland
01.12.2023

Whether you're making a library or making React components for your own sake, there's one technique you must know: polymorphism. It's when one thing can be multiple shapes, as when a button can act as a link. Used correct, it can save you from maintaining many variants, and at the same time give your users the flexibility they need. In this text I will show you how to utilize two of the most known ways of implementing polymorphism in React: the "as"- and "asChild"-patterns.

Har du råd til native mobilutvikling?

Frontend
Artikkel (7 min)
Fra Erik Wendel
22.12.2022

Trenger du virkelig en native mobilapp?

The <style> tag is like any other HTML tag

Frontend
Artikkel (2 min)
Fra Einar Afiouni
20.12.2022

Lær deg CSS, ikke Tailwind

Frontend
Artikkel (5 min)
Fra Kjetil Svalestuen
20.12.2022

Teamet mitt startet nylig å skrive CSS. Vi er ferdig med superspråk som kompilerer ned til CSS. Vi bruker ikke noen rammeverk, men skriver gode, gamle CSS-regler. Det er på tide å forenkle hvordan vi tenker på styling.

React – et hjertesukk

Frontend
Artikkel (3 min)
Fra Bendik Solheim
19.12.2022

Ahh, React. Min gode venn gjennom mange år. Jeg skal være ærlig: forholdet vårt starta litt turbulent. Jeg var usikker på om det å blande HTML inn i Javascripten egentlig var noen god idé. Det tok faktisk et par år før du klarte å overbevise meg! Men du var heldigvis tålmodig. For det som starta som en skepsis viste seg å etter hvert til å bli til en aldri så liten forelskelse! Ohh boy!

Gjør nettsiden din levende med CSS-transitions

Frontend
Artikkel (6 min)
Fra Marcus Haaland
19.12.2022

Nettsider med animasjon får litt personlighet, og det skal lite til for å oppnå det. Her er en guide til bruk av CSS-transitions.

Stop using PNG and JPEG on the web!

Frontend
Artikkel (3 min)
Fra Mats Byrkjeland
17.12.2022

PNG and JPEG are the most common image formats that exist. But they are old and not optimized for use on the web. It's 2022 and there are better alternatives! Ditch PNG and JPEG now and adopt WebP.

Put event logic in event handlers in React

Frontend
Artikkel (4 min)
Fra Caroline Odden
16.12.2022

Changing the state of your component based on the interaction of a user is a common scenario in a React application. Your first instinct may be to put the event logic in a useEffect that depends on some value to change so the effect can be triggered. But why put the event-specific logic some other place than event handlers? To avoid misbehavior in your application, put event logic in the event handlers and not in useEffects.

Compute view logic during render in React

Frontend
Artikkel (4 min)
Fra Caroline Odden
15.12.2022

Updating view logic based on some state or props is a common thing to do in a React application, and the go-to method is typically by putting every state update in one or more useEffects. However, this will lead to unnecessary updates and unmaintainable code. Let's take a look at how updating view logic is better by doing it during render rather than useEffects.