[工作筆記] Antd table row(tr) change background is not working

Bonnie Yu
2 min readAug 23, 2018

--

在這邊卡了三分二十五秒超過 ...
改不動顏色好鬱卒,馬上來做個筆記以免以後忘記
antd 是讓人又愛又恨的套件無誤 🤦‍♀

我想要改成的結果

原本 antd table 預設 tr hvoer background 是天藍色的,我想要改成淺灰色,依照 F12 看到的 row hover 是這樣設定的,但是我照本宣客的貼上蓋顏色也無法撼動它。

.ant-table-thead > tr.ant-table-row-hover td,
.ant-table-tbody > tr.ant-table-row-hover td,
.ant-table-thead > tr:hover td,
.ant-table-tbody > tr:hover td{
background: $grey-200;
}

後來發現要在 tr:hover 後再設定一個 td 才有辦法蓋過原本的樣式 ...
豪 .... 討厭的感覺 TMD

#我的筆記都是在自己碎碎念

--

--