0

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

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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.