I am learning PWA on magento 2. I trying to add my static block and custom.css file into home page but it not working. So anybody have solution help me apply all my custom css content into homepage.
Homepage.js
import React from 'react';
import cmsBlock from "@magento/venia-ui/lib/components/CmsBlock";
import defaultClasses from './custom.css';
const HomePage = props => {
const content = cmsBlock({"identifiers": "sale-block"});
return (
<div className={defaultClasses.blocks_promo}>{content}</div>
);
};
export default HomePage;
custom.css
.blocks_promo {
margin-bottom: 16px;
background: red;
}
.blocks_promo .info{
display: block;
color: red;
}
:blobal(.block-promo-wrapper) {
float: left;
width: 50%;
}
Now I see class .blocks_promo is affecting but class .block-promo-wrapper is not. Thanks ALl
asked Jan 22, 2021 at 6:58
1 Answer 1
Its seems like keyword mistake :
:global(.block-promo-wrapper) {
float: left;
width: 50%;
}
Replace global keyword in your css.
answered May 13, 2021 at 5:25
default