Skip to content

Second Style #71637

@Pixelous

Description

@Pixelous

Hi,

I have this In block.json:

"editorStyle": "file:./index.css",
"style": [
    "file:./style-index.css",
    "file:./swiper-bundle.css"
],

The first style is injecting fine in front end but the second one "file:./swiper-bundle.css" is not inserting at all in front end.

In the editor they work both.

Can someone point me in the right direction please?

I am reading these docs:

https://make.wordpress.org/core/2021/12/15/using-multiple-stylesheets-per-block/

https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/applying-styles-with-stylesheets/

In index.js I use these lines:

/**
 * CSS
 */
import './editor.css';
import './style.css';
import './swiper-bundle.css';

Or should I use classic wp_enqueue_style instead for multiple files?

Kind regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs Technical FeedbackNeeds testing from a developer perspective.[Feature] Block APIAPI that allows to express the block paradigm.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions