{"id":83,"date":"2020-03-26T15:10:29","date_gmt":"2020-03-26T15:10:29","guid":{"rendered":"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/react-js-authentication-with-laravel-back-end-copy\/"},"modified":"2020-03-26T15:31:54","modified_gmt":"2020-03-26T15:31:54","slug":"customize-override-ant-design-theme-in-laravel-reactjs","status":"publish","type":"post","link":"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/","title":{"rendered":"Customize\/Override Ant Design theme in Laravel ReactJS"},"content":{"rendered":"\n<p>Here&#8217;s a quick guide for overriding Ant Design theme variables (colors) in a ReactJS project using Laravel Mix. I will assume that you already have configured a ReactJS project with Laravel Mix. If not, than you can easily find this documentation:  <a href=\"https:\/\/laravel.com\/docs\/master\/mix\">https:\/\/laravel.com\/docs\/master\/mix<\/a><\/p>\n\n\n\n<p>Inspired by AntD documentation here:  <a href=\"https:\/\/ant.design\/docs\/react\/customize-theme\">https:\/\/ant.design\/docs\/react\/customize-theme<\/a> I&#8217;ve managed to make it work in Laravel:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Let&#8217;s start with dependencies<\/h2>\n\n\n\n<p>First, you have to run the following command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npm install antd \nnpm install --save-dev  css-loader  less  less-loader  style-loader<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configuring Laravel Mix<\/h2>\n\n\n\n<p>Next, in your project root shall be a file named: <code>webpack.mix.js<\/code>. At the end of it you shall have something like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> \n mix.react('resources\/assets\/js\/app.js',&nbsp;'public\/js')\n&nbsp;&nbsp;&nbsp;&nbsp;.less('resources\/assets\/less\/app.less',&nbsp;'public\/css',\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modifyVars:&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'primary-color':&nbsp;'#0BD37E',\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;javascriptEnabled:&nbsp;true,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<\/pre>\n\n\n\n<p>Make sure you have <code>app.less<\/code> created in the desired location.<\/p>\n\n\n\n<p>At the top of that file you should inport the default antd styles using: <code>@import&nbsp;\"~antd\/dist\/antd.less\";<\/code><\/p>\n\n\n\n<p>Rest of your application styling should go below that.<\/p>\n\n\n\n<p>As you can in <code>modifyVars<\/code> object, we have overwritten the value for primary color.<\/p>\n\n\n\n<p>You can find all other variables with their default values here:  <a href=\"https:\/\/github.com\/ant-design\/ant-design\/blob\/master\/components\/style\/themes\/default.less\">https:\/\/github.com\/ant-design\/ant-design\/blob\/master\/components\/style\/themes\/default.less<\/a> <\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Wrap in up<\/h1>\n\n\n\n<p>Hope these information saved you some time.<\/p>\n\n\n\n<p>If you&#8217;d like to know more details just let me know in comments section.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a quick guide for overriding Ant Design theme variables (colors) in a ReactJS project using Laravel Mix. I will assume that you already have configured a ReactJS project with Laravel Mix. If not, than you can easily find this documentation: https:\/\/laravel.com\/docs\/master\/mix Inspired by AntD documentation here: https:\/\/ant.design\/docs\/react\/customize-theme I&#8217;ve managed to make it work in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-83","post","type-post","status-publish","format-standard","hentry","category-front-end-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Customize\/Override Ant Design theme in Laravel ReactJS - Crosstech IT | Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Customize\/Override Ant Design theme in Laravel ReactJS - Crosstech IT | Blog\" \/>\n<meta property=\"og:description\" content=\"Here&#8217;s a quick guide for overriding Ant Design theme variables (colors) in a ReactJS project using Laravel Mix. I will assume that you already have configured a ReactJS project with Laravel Mix. If not, than you can easily find this documentation: https:\/\/laravel.com\/docs\/master\/mix Inspired by AntD documentation here: https:\/\/ant.design\/docs\/react\/customize-theme I&#8217;ve managed to make it work in [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/\" \/>\n<meta property=\"og:site_name\" content=\"Crosstech IT | Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-26T15:10:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-03-26T15:31:54+00:00\" \/>\n<meta name=\"author\" content=\"Daniel Isac\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daniel Isac\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/\"},\"author\":{\"name\":\"Daniel Isac\",\"@id\":\"https:\/\/crosstechit.com\/blog\/#\/schema\/person\/87da6aed97c0aeed77f83359af00d85e\"},\"headline\":\"Customize\/Override Ant Design theme in Laravel ReactJS\",\"datePublished\":\"2020-03-26T15:10:29+00:00\",\"dateModified\":\"2020-03-26T15:31:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/\"},\"wordCount\":202,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/crosstechit.com\/blog\/#organization\"},\"articleSection\":[\"Front end development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/\",\"url\":\"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/\",\"name\":\"Customize\/Override Ant Design theme in Laravel ReactJS - Crosstech IT | Blog\",\"isPartOf\":{\"@id\":\"https:\/\/crosstechit.com\/blog\/#website\"},\"datePublished\":\"2020-03-26T15:10:29+00:00\",\"dateModified\":\"2020-03-26T15:31:54+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/crosstechit.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Customize\/Override Ant Design theme in Laravel ReactJS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/crosstechit.com\/blog\/#website\",\"url\":\"https:\/\/crosstechit.com\/blog\/\",\"name\":\"Crosstech IT | Blog\",\"description\":\"Apps. Smart. Fun.\",\"publisher\":{\"@id\":\"https:\/\/crosstechit.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/crosstechit.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/crosstechit.com\/blog\/#organization\",\"name\":\"Crosstech IT | Blog\",\"url\":\"https:\/\/crosstechit.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/crosstechit.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/crosstechit.com\/blog\/wp-content\/uploads\/2019\/01\/cropped-favicon.png\",\"contentUrl\":\"https:\/\/crosstechit.com\/blog\/wp-content\/uploads\/2019\/01\/cropped-favicon.png\",\"width\":190,\"height\":190,\"caption\":\"Crosstech IT | Blog\"},\"image\":{\"@id\":\"https:\/\/crosstechit.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/crosstechit.com\/blog\/#\/schema\/person\/87da6aed97c0aeed77f83359af00d85e\",\"name\":\"Daniel Isac\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/crosstechit.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/382d66c0eb0b506a1e6e5a10ae490d874d790f13b1af6a6f3958c1a7b3f23743?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/382d66c0eb0b506a1e6e5a10ae490d874d790f13b1af6a6f3958c1a7b3f23743?s=96&d=mm&r=g\",\"caption\":\"Daniel Isac\"},\"url\":\"https:\/\/crosstechit.com\/blog\/author\/danielcrt\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Customize\/Override Ant Design theme in Laravel ReactJS - Crosstech IT | Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/","og_locale":"en_US","og_type":"article","og_title":"Customize\/Override Ant Design theme in Laravel ReactJS - Crosstech IT | Blog","og_description":"Here&#8217;s a quick guide for overriding Ant Design theme variables (colors) in a ReactJS project using Laravel Mix. I will assume that you already have configured a ReactJS project with Laravel Mix. If not, than you can easily find this documentation: https:\/\/laravel.com\/docs\/master\/mix Inspired by AntD documentation here: https:\/\/ant.design\/docs\/react\/customize-theme I&#8217;ve managed to make it work in [&hellip;]","og_url":"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/","og_site_name":"Crosstech IT | Blog","article_published_time":"2020-03-26T15:10:29+00:00","article_modified_time":"2020-03-26T15:31:54+00:00","author":"Daniel Isac","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Daniel Isac","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/#article","isPartOf":{"@id":"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/"},"author":{"name":"Daniel Isac","@id":"https:\/\/crosstechit.com\/blog\/#\/schema\/person\/87da6aed97c0aeed77f83359af00d85e"},"headline":"Customize\/Override Ant Design theme in Laravel ReactJS","datePublished":"2020-03-26T15:10:29+00:00","dateModified":"2020-03-26T15:31:54+00:00","mainEntityOfPage":{"@id":"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/"},"wordCount":202,"commentCount":0,"publisher":{"@id":"https:\/\/crosstechit.com\/blog\/#organization"},"articleSection":["Front end development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/","url":"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/","name":"Customize\/Override Ant Design theme in Laravel ReactJS - Crosstech IT | Blog","isPartOf":{"@id":"https:\/\/crosstechit.com\/blog\/#website"},"datePublished":"2020-03-26T15:10:29+00:00","dateModified":"2020-03-26T15:31:54+00:00","breadcrumb":{"@id":"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crosstechit.com\/blog\/2020\/03\/26\/customize-override-ant-design-theme-in-laravel-reactjs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/crosstechit.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Customize\/Override Ant Design theme in Laravel ReactJS"}]},{"@type":"WebSite","@id":"https:\/\/crosstechit.com\/blog\/#website","url":"https:\/\/crosstechit.com\/blog\/","name":"Crosstech IT | Blog","description":"Apps. Smart. Fun.","publisher":{"@id":"https:\/\/crosstechit.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/crosstechit.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/crosstechit.com\/blog\/#organization","name":"Crosstech IT | Blog","url":"https:\/\/crosstechit.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/crosstechit.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/crosstechit.com\/blog\/wp-content\/uploads\/2019\/01\/cropped-favicon.png","contentUrl":"https:\/\/crosstechit.com\/blog\/wp-content\/uploads\/2019\/01\/cropped-favicon.png","width":190,"height":190,"caption":"Crosstech IT | Blog"},"image":{"@id":"https:\/\/crosstechit.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/crosstechit.com\/blog\/#\/schema\/person\/87da6aed97c0aeed77f83359af00d85e","name":"Daniel Isac","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/crosstechit.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/382d66c0eb0b506a1e6e5a10ae490d874d790f13b1af6a6f3958c1a7b3f23743?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/382d66c0eb0b506a1e6e5a10ae490d874d790f13b1af6a6f3958c1a7b3f23743?s=96&d=mm&r=g","caption":"Daniel Isac"},"url":"https:\/\/crosstechit.com\/blog\/author\/danielcrt\/"}]}},"_links":{"self":[{"href":"https:\/\/crosstechit.com\/blog\/wp-json\/wp\/v2\/posts\/83","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/crosstechit.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crosstechit.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crosstechit.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crosstechit.com\/blog\/wp-json\/wp\/v2\/comments?post=83"}],"version-history":[{"count":2,"href":"https:\/\/crosstechit.com\/blog\/wp-json\/wp\/v2\/posts\/83\/revisions"}],"predecessor-version":[{"id":86,"href":"https:\/\/crosstechit.com\/blog\/wp-json\/wp\/v2\/posts\/83\/revisions\/86"}],"wp:attachment":[{"href":"https:\/\/crosstechit.com\/blog\/wp-json\/wp\/v2\/media?parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crosstechit.com\/blog\/wp-json\/wp\/v2\/categories?post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crosstechit.com\/blog\/wp-json\/wp\/v2\/tags?post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}