Add Custom Css or Js In Admin Magento 2

Sometime you want to modify admin panel because it is boring with you, today i will show you how to add custom js and css in admin panel.

Step 1: Create a module for example Vendor/Module

 

Step 2: Create a new file view/adminhtml/layout/default.xml in the module

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Vendor_Module::css/test.css"/>
<script src="Vendor_Module::js/test.js"/>
</head>
</page>


Step 3: Add .css file and add js file in web folder as below path

view/adminhtml/web/css/test.css
view/adminhtml/web/js/test.js 

Done, hope this article will help you in someway, see you in next post.