Martin Koníček

Blog

NextJS - global font with css style module

Showcase image

I was wondering, how to set-up global font module using css style module in NextJS, here is how.

layout.tsx

import { Poppins } from 'next/font/google';

const poppins = Poppins({
  weight: ['700'],
  subsets: ['latin'],
  variable: '--poppins-font',
});

export default function RootLayout({
...
  return (
    <html lang="en">
      <body className={`myclasses ${poppins.variable}`}>
...

page.tsx

import styles from './styles.module.css'

style.module.css

.menu {
  font-family: var(--poppins-font),sans-serif;
}
  • WebSocket connection to WireGuard
    WebSocket connection to WireGuardIn some countries (e.g. Egypt) or some hotels, VPN connections are blocked and only possibility is to tunnel them through WebSocket, in this article I will focus on that.
  • cs | en