I need assistance with a specific task in my React project, where I am utilizing the Ant Design framework along with css-modules bundling.
My goal is to target certain Ant classes based on the parent div's generated class using css-modules.
The current code I have is not achieving the desired result:
.container
flex-grow: 1 !important
.container
\:global &.ant-layout-sider-collapsed
.anticon
font-size: 16px
margin-left: 8px
.nav-text
display: none
.ant-menu-submenu-vertical > .ant-menu-submenu-title:after
display: none
This results in:
.Navigation__container___1S9AX {
flex-grow: 1 !important; }
.container.ant-layout-sider-collapsed .anticon {
font-size: 16px;
margin-left: 8px; }
.container.ant-layout-sider-collapsed .nav-text {
display: none; }
.container.ant-layout-sider-collapsed .ant-menu-submenu-vertical > .ant-menu-submenu-title:after {
display: none;
What I want to achieve looks like this:
.Navigation__container___1S9AX {
flex-grow: 1 !important; }
.Navigation__container___1S9AX.ant-layout-sider-collapsed .anticon {
font-size: 16px;
margin-left: 8px; }
.Navigation__container___1S9AX.ant-layout-sider-collapsed .nav-text {
display: none; }
.Navigation__container___1S9AX.ant-layout-sider-collapsed .ant-menu-submenu-vertical > .ant-menu-submenu-title:after {
display: none;
Any help or guidance on understanding how to achieve this in css-modules would be greatly appreciated as my attempts at researching more information have been unsuccessful.