What are some ways to customize icons in a NextJs project?

Having trouble changing the color of the icon using this method. The image is being sourced from "next/image"

<Image 
  className={styles.icon} 
  alt="arrow" 
  src={ArrowIcon} 
/>

module.css

.icon {
  stroke: blanchedalmond;
  & path {
    stroke: blanchedalmond;
    color: blanchedalmond;
  }
}

Answer №1

Hey there! You can create a new file called "file.css" and then import it into your js-file like this...

import "./file.css";

After that, I believe you can utilize the following code snippet:

<Image 
   className="icon" 
   alt="arrow" 
   src={ArrowIcon} 
/>

In your css file, remember to use:

.icon {your style...}

Best regards,

Jonas

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the method for obtaining the width of a g element?

I am encountering an issue with retrieving the width of the <g></g> element using jQuery. Both .innerWidth() and width() methods are returning null for me. Is there a way to obtain the width of the <g></g> element using jQuery? I a ...

The ability to choose only one option in a checkbox within a grid view column

In my grid view, I have a checkbox in the last column. I am trying to ensure that only one row can be selected at a time. <tr *ngFor="let permit of PermitDetails" (click)="GoByClick(permit)"> <td style="text-align: center">{{permit.TVA_BAT ...

Display a popover when the button is clicked using jQuery

Is there a way to show a notification message using popover? I've managed to make it work, but I'm facing an issue where the popover doesn't appear on the first click of a button after the page loads. Here is the code snippet: <button ty ...

Conceal/Inactivate element when scrolling, and once scrolling comes to a halt, reveal it once more

I have been working on creating a div tag to overlay an embed tag and added some javascript to prevent users from right-clicking to download the pdf inside the embed tag (even though it may seem unnecessary, it was requested by my customer). Here is the ma ...

The font styles shift and vertical bars vanish when placed under images

I'm currently facing some challenges with the text placement beneath the images on my website that I am constructing: 1) The font for "Back to home page" unexpectedly changes from the specified style (Georgia, 0.9em) in Firefox but remains consistent ...

Ensure that the content within each column stays contained within its designated area and does not

Is there a way to prevent text in one column from overlapping with another column if it's too long? <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/> <div class="row vdivide"> &l ...

Problem with datepicker interface not aligning properly with Bootstrap grid

I am encountering a challenge with aligning the input controls in my UI design. Specifically, I am trying to create rectangular borders/containers around each set of input controls and looking for a way to achieve this using Booststrap. For reference, y ...

Updating the contents of a span using multiple element IDs in JavaScript

I'm a beginner and struggling to articulate my question effectively. Please bear with me as I try to explain my issue through code. Within my webpage, there is a drop-down list represented by <selector> with the ID: list-category. In addition, ...

Delete the unauthorized number located before the doctype declaration

Currently, I am implementing codeigniter with a layout view as a standard page. Within this layout, I include elements such as the menu bar and content. Oddly enough, all pages display without issues except for one. This particular page displays a random ...

What is the best way to send a string literal as a parameter to a method triggered by a click event

I'm trying to pass a string literal to a method as a click handler. <button (click)="changeLanguage('en')">EN</button> The above code is not working. Any suggestions on how to achieve this? ...

Utilizing CSS for Horizontal Scroll-Snap-Type

My website utilizes Bootstrap 4, horizontal scrolling (with the help of jquery.mousewheel.js), and native CSS Snapping. I am using Chrome 81 and do not concern myself with old or unsupported browsers. The issue arises when I add scroll-snap-type: x mandat ...

What is the reason for min-content not being compatible with auto-fill or auto-fit?

My confusion lies in the fact that this code snippet works: .grid { display: grid; grid-template-columns: repeat(4, min-content); } Whereas this one does not: .grid { display: grid; grid-template-columns: repeat(auto-fill, min-content); } I am ...

Keep the sub-menu in a kendo context menu from closing until the user either hovers over another menu item or clicks outside of the current item

Please take a look at this example: Due to the small size of sub-items, the sub-menu closes quickly when hovering over the menu and losing focus. My goal is to keep an opened sub-menu from closing until the user hovers over another menu item or clicks on ...

"Exploring the concept of responsive design: understanding the distinction between media query width and actual

Apologies for the lengthy description, but I want to provide as much detail as possible. I recently encountered an issue (which I managed to resolve, but the root cause eluded me). The crux of the problem was that when resizing the browser, specificall ...

I am looking to include a popover within my modal using Bootstrap version 3.0.2

Hey there, I'm having an issue where the popover that should be inside the modal is actually appearing outside of it in the top left corner, not visible within the modal itself. Below is my index code: <button type="button" id="example" class="bt ...

Can someone explain why my button icons are not aligning to the center properly?

I have a small issue with the icons I pulled from react-icons - they appear slightly raised within the buttons. How can I position them in the middle? That's my only query, but I can't post it alone due to mostly having code in my post. What an ...

Warning: An error occurred with undeclared variables... missing variable declaration

Hey everyone, I recently made a post but it seems like my explanation was not clear enough. So here's the issue - I have a products page with a URL structure like http:.......rest_id=3/area='Enfield'. I've been using a similar query on ...

Audio support across multiple channels on iOS and Android web browsers

After stumbling upon a helpful link to a page here on StackOverflow discussing "Creating Audio using Javascript in <audio>", and also finding a resource on another website detailing how to play audio on multiple channels, I have come across a questio ...

Updating an iframe's content URL

I am currently working on building a website using Google Web Design and everything is going well so far. I have added an iFrame to the site and now I am trying to figure out how to change its source when a button is pressed. Most of the information I fo ...

Utilize Jquery to extract the element's identifier and substitute the value in a[href*=' # '] with the extracted Id

I am in the process of developing a one-page portfolio website with a fixed vertical header. I want the headings on the header to highlight as I scroll down to the related sections of the page. <div class="vert-nav"> <ul> & ...