{"id":46410,"date":"2025-08-16T08:43:01","date_gmt":"2025-08-16T08:43:01","guid":{"rendered":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/?p=46410"},"modified":"2025-08-16T08:43:02","modified_gmt":"2025-08-16T08:43:02","slug":"css-in-gutenberg-editor","status":"publish","type":"post","link":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/css-in-gutenberg-editor\/","title":{"rendered":"CSS In Gutenberg editor"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"css-needs-minimum-selector\">CSS Needs minimum selector<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">.wp-block{}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Load CSS in Editor<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;?php\n\nfunction enqueue_custom_editor_styles() {\n\twp_enqueue_style(\n\t\t'in-editor',\n\t\tget_stylesheet_directory_uri() . '\/editor.css',\n\t\tarray(),\n\t\tfilemtime( get_stylesheet_directory() . '\/editor.css' )\n\t);\n}\nadd_action( 'enqueue_block_editor_assets', 'enqueue_custom_editor_styles' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Load CSS in Theme (Front End)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;?php\n\nfunction enqueue_custom_block_styles() {\n\twp_enqueue_style(\n\t\t'in-theme',\n\t\tget_stylesheet_directory_uri() . '\/editor.css',\n\t\tarray(),\n\t\tfilemtime( get_stylesheet_directory() . '\/editor.css' )\n\t);\n}\nadd_action( 'enqueue_block_assets', 'enqueue_custom_block_styles' );<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>CSS Needs minimum selector Load CSS in Editor Load CSS in Theme (Front End)<\/p>\n","protected":false},"author":1,"featured_media":46595,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"CSS In Gutenberg editor - Code DPlugins","description":"CSS Needs minimum selector Load CSS in Editor Load CSS in Theme (Front End)"},"_slim_seo_primary_term_category":0,"_slim_seo_primary_term_post_tag":0,"footnotes":""},"categories":[90],"tags":[79,122,120,121,104],"dpc_library":[],"class_list":["post-46410","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gutenberg","tag-css","tag-development","tag-editor","tag-gutenberg","tag-load-styles"],"_links":{"self":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts\/46410","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/comments?post=46410"}],"version-history":[{"count":0,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts\/46410\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/media\/46595"}],"wp:attachment":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/media?parent=46410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/categories?post=46410"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/tags?post=46410"},{"taxonomy":"dpc_library","embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/dpc_library?post=46410"}],"curies":[{"name":"wp","href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/api.w.org\/{rel}","templated":true}]}}