Skip to content

fail to link css file in html file #2223

@wangtengda0310

Description

@wangtengda0310

my folders tree like:

C:.
│   deps.edn
│   dev.cljs.edn
│
├───resources
│   └───public
│           index.html
│
└───src
    └───hello_world
            core.cljs

my deps.edn

{:deps
 {
 cljsjs/react-dom {:mvn/version "17.0.2-0"}
 cljsjs/react {:mvn/version "17.0.2-0"}
 reagent {:mvn/version "1.1.0"}
 cljsjs/antd {:mvn/version "4.6.1-0"}
 com.bhauman/figwheel-main {:mvn/version "0.2.16"}
 com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
 org.slf4j/slf4j-simple {:mvn/version "1.7.36"}
 }
:paths ["src" "target" "resources"]}

my dev.cljs.edn

{:main hello-world.core}

my resources\public\index.html

<!DOCTYPE html>
<html>
  <head>
    <link href="cljsjs/antd/production/antd.min.inc.css" rel="stylesheet" type="text/css">
  </head>
  <body>
    <div id="app"></div>
    <script src="cljs-out/dev-main.js"></script>
  </body>
</html>

my src\hello_world\core.cljs

(ns hello-world.core
  (:require [antd :as antd]
        [reagent.core :as r]
        [reagent.dom :as rdom]))

(defn c [] [:> js/antd.Calendar])

(rdom/render [c] (js/document.getElementById "app"))

and I start with command

clojure -M -m figwheel.main -b dev -r

but the result is without css

image
image

how can I use the css file?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions