AtomicX - HTML 原生元件化框架
HTML
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/gh/Jeffrey0117/atomicX/atomicX.js"></script>
<!---------------------------------------------------------->
<!-- Make your macro element (this will be rendered as well) -->
<div class="@macro:MyCard bg-white p-4 rounded-lg shadow w-[300px] mx-auto my-8">
<h3 class="text-xl">Try to change text here...</h3>
<p class="text-gray-600">something about this stuff...</p>
</div>
<!-- @macro & @micro Usage -->
<Mycard></Mycard> <!-- This one will be exact as @macro:Mycard -->
<MyCard class="@micro:Newest bg-red-300" h3="{The NEW Prodcut}" p="{Here is NEW stuff} text-xl text-red-500"></MyCard> <!-- Here is how you custom your @macro element -->
<Newest></Newest> <!-- And you could use @macro element as orginal UI -->
<Newest class="bg-green-500" h3="{I CAN EVEN CHANGE THIS} text-white" p="{of course here can too} text-white"></Newest> <!-- Of course you can custom this @micro element -->
<!---------------------------------------------------------->
<!-- Be Creative to use @macro here -->
<div class="@macro:MyComponent ...">
<!-- do something here -->
</div>
<MyComponent></MyComponent>
<!-- Be Creative to use & @micro here -->
<MyComponent class="@micro:DiffComponent"></MyComponent>
<DiffComponent></DiffComponent>
JavaScript
tailwind.config = {
/* Tailwind CSS config */
}