Issue #1561💬 AnsweredOpened November 5, 2018by froderf0 reactions

Css shorthand

快速解答by artf

That happens due to the browser's CSS parser, which is used by default in GrapesJS. You can prevent that by using grapesjs-parser-postcss

Read full answer below ↓

Question

Hello @artf , is there a way to not convert a css added into shorthand? for example: border: 4px solid rgb(239, 13, 24);

after visiting the code viewer, the above css is converted to the following

    border-top-color: rgb(239, 13, 24);
    border-right-color: rgb(239, 13, 24);
    border-bottom-color: rgb(239, 13, 24);
    border-left-color: rgb(239, 13, 24);
    border-top-style: solid;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: solid;
    border-top-width: 4px;
    border-right-width: 4px;
    border-bottom-width: 4px;
    border-left-width: 4px;

how can I prevent this kind of conversion? What I want is to remain this style border: 4px solid rgb(239, 13, 24); to what is it.

Answers (2)

artfNovember 8, 2018

That happens due to the browser's CSS parser, which is used by default in GrapesJS. You can prevent that by using grapesjs-parser-postcss

lock[bot]November 8, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.