How to Apply CSS ID Selectors in Next JS?

I’m new to Next JS (after learning that npx create-react-app is discontinued), and I’m trying to convert one of my websites from pure HTML, SASS (CSS) and JavaScript to using Next JS and SASS.

One component I’m working on is my navbar, which as SASS/CSS class names and ID’s’ applied to it:

import React from 'react'
import navbar from "./navbar.module.scss"

const Navbar = () => {
    return (
        <div>
            <header className={navbar.nav} id={"horizontal"}>
                <div className={navbar.nav_name}><a href="./index.html">Ryan Barillos</a></div>
                <nav className={navbar.nav_links} id="vertical">
                <a href="./pages/about.html" className={navbar.nav_btn} id="active">About Me</a>
                <a href="./pages/projects.html" className={navbar.nav_btn}>Projects</a>
                <a href="./pages/music.html" className={navbar.nav_btn}>Music</a>
                <a href="./pages/contact.html" className={navbar.nav_btn}>Contact</a>
            </nav>
            <div className={navbar.btn_menu} id="open"></div>
        </header>

    </div >
    )
}
export default Navbar
/*
Navigation Bar

Reference(s)
- https://youtu.be/PwWHL3RyQgk?si=V-Lax5dIxIbxD7WI
- https://youtu.be/dPHNrNgM8jI?si=TtWs_gxAgq-NTW-N
- https://youtu.be/5zDYchk3C5k?si=uTUCpG7awRjH64x4
- https://youtu.be/41ZBkZUVApc?si=rVLj0VenAPs0__M_ grid vs. flexbox

Fix(es)
- /questions/37785345/how-to-get-flexbox-to-include-padding-in-calculations
*/

// Dependencies
@use "../../styles/globals" as global;

// Variables, Modules & Mixins
$size_name: 25px;
$size_pad: 2vw;

// To change button color depending on state
@mixin btnColor($state) {
    // border-style: solid;
    border-radius: 5px;

    @if $state =="hover" {
        background-color: hsl(0, 0%, 20%);
    }

    @else if $state =="active" {
        background-color: hsl(0, 0%, 100%);
        // height: 75%;
    }
}

/*
    Navigation Bar
*/
.nav {
    // Global Settings
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    background-color: black;

    /*
    Menu Horizontal - Settings
    */
    &#horizontal {
        // Position
        z-index: 999;
        left: 0;

        // Size settings
        height: global.$height_navbar;

        // Display settings
        align-items: flex-end;
        * {
            color: blue;
        }
    }

    // Menu Vertical - Settings
    &#vertical {
        height: 100%;
        flex-direction: column;
        overflow: scroll;
        visibility: hidden;
        background-color: hsl(0, 0%, 10%);
    }


    /*
    Children properties
    - Center them on both x-axis and y-axis
    - Element's height = Parent Height (button height = navbar height)
    - Text color is WHITE
    */
    * {
        display: flex;
        align-items: center;
        justify-content: center;
        height: inherit;
        color: white;
    }

    // Name Title (or Brand Title)
    &_name {
        // Add padding on navbar
        padding-left: $size_pad;

        // Style settings
        margin-right: auto;
        @include global.poppins($weight: "semibold");
        font-size: $size_name;
    }

    /*
    Navigation Buttons

    NOTE:
    - for button styling, please go to "./button.scss"
    */
    &_links {
        &#horizontal {
            // Add padding on navbar
            padding-right: $size_pad;

            * {
                padding: 0 10px;
                height: 70%;
            }
            background-color: red;
        }

        &#vertical {
            display: flex;
            flex-flow: column;
            // overflow-y: scroll;
            justify-content: flex-start;
            font-size: 1.25rem;

            margin-top: global.$height_navbar;

            * {
                width: 100%;
                height: 10%;
            }
        }
    }

    /*
    Buttons
    */
    &_btn {
        &:hover {
            @include btnColor("hover");
        }
    
        &:active {
            color: black;
            @include btnColor("active");
        }
    
        // ACTIVE - Highlight Color
        &#active {
            color: black;
            @include btnColor("active");
    
            &:hover {
                background-color: hsl(0, 0%, 70%);
            }
    
            &:active {
                color: white;
                background-color: hsl(0, 0%, 40%);
            }
        }

        &_menu {
            &#open {
                background-image: url("../../../public/icons/navigation/menu.svg");
            }
        
            &#close {
                background-image: url("../../../public/icons/navigation/close.svg");
            }
        
            background-size: 100%;
            background-repeat: no-repeat;
        
            background-position: center;
            margin-right: 2vw;
        
            // height: ;
            width: 30px;
        }
    }

}

/*
Dropdown (Hamburger) Menu Button
*/
.btn-menu {
    &#open {
        background-image: url("../../../public/icons/navigation/menu.svg");
    }

    &#close {
        background-image: url("../../../public/icons/navigation/close.svg");
    }

    background-size: 100%;
    background-repeat: no-repeat;

    background-position: center;
    margin-right: 2vw;

    // height: ;
    width: 30px;
}


@media screen and (max-width: 800px) {

    .links {
        display: none;
    }

    .btn-menu {
        display: block;
    }
}

@media screen and (min-width: 800px) {
    // .container-social {
    //     $spaceLR: 5rem;
    //     margin-left: $spaceLR;
    //     margin-right: $spaceLR;
    // }

    .btn-menu {
        display: none;
    }

    .nav {
        &#vertical {
            // display: none;
            // visibility: visible;
            visibility: hidden;
        }
    }
}

As far as globals.scss is concerned, please refer to the global.scss in my Github repo


Despite how rough it is right now—again, just starting out on Next JS—I’m having a hard time on how to apply my style ID’s’ to my components, as none of them are applying at all. There is no mention on Next JS’s Documentation how to do so, and only skips to applying classNames—not what I need for my situation, and so I’m stuck as to how to make my SASS/CSS styling work.


I am aware a similar question was asked a few years ago here, but the answer given provides no code on how to achieve what I want to do, only giving instructions that only those experienced will understand. (I’m not, and I find no help elsewhere.)

So, how am I supposed to apply CSS ID styles onto my Next/React components other than class names, then?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật