How do I use @carbon/react
with Remix?
#6908
Unanswered
siennathesane
asked this question in
Q&A
Replies: 2 comments 1 reply
-
As a potentially temporary workaround, I was able to get it mostly working if I did a global find and replace ( |
Beta Was this translation helpful? Give feedback.
0 replies
-
I've managed to solve it by adding a key to disable $css--font-face: false;
@import '@carbon/styles'; But also I've imported the fonts in the import { cssBundleHref } from "@remix-run/css-bundle";
import type { LinksFunction } from "@remix-run/node";
import carbonCss from "./styles/carbon.css";
export const links: LinksFunction = () => [
...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
{ rel: "preconnect", href: "https://fonts.googleapis.com" },
{
rel: "preconnect",
href: "https://fonts.gstatic.com",
crossOrigin: "anonymous",
},
{
rel: "stylesheet",
href: "https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap",
},
{ rel: "stylesheet", href: carbonCss },
]; |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm not a JS/TS expert, but Remix has been a lifesaver. I want to use the Carbon Design System by IBM, but the
sass
configuration I need is kicking my butt because I don't really understand how to use Sass outside of webpack (and even then, still not an expert)The errors I'm getting are like this:
My
{root}/styles/global.scss
file only contains@use "@carbon/react";
, and the Sass command I'm using is:The generated
{root}/app/styles/global.css
file contains a bunch of theseurl()
definitions for the@ibm/plex
font:I did a bunch of digging into what webpack actually does, and it turns out the most useful thing it does is resolve all the imports URLs when Sass is being used because Sass doesn't resolve anything. I am at the end of my JS/TS ecosystem knowledge, and I could use an assist.
How do I consume
@carbon/react
with Remix?Beta Was this translation helpful? Give feedback.
All reactions