Zusty CSS Logo
Zusty CSS Logo
Version 1.2.0 is out now. Check out Release Notes.

General Helpers

General utility classes to.


Display

If You want to expand/collapse something for any reason or for debugging purposes you can use following classes to any element:

Based on theme

If you want to expand/collapse any element on dark mode you can use:

What if you want your element to be only visible on dark mode? Simply add both zust-hidden and zust-visible@dark classes. Then see the magic. It's good when you want to change page content based on theme, like pictures.

Hey, Look at me I'm Visible, Thanks to Dark Mode.
<span class="zust-hidden zust-visible@dark">Hey, Look at me I'm Visible, Thanks to Dark Mode.</span>

Based on breakpoint

It has support for Breakpoints.

If you want to show something only on certain breakpoint then add class zust-visible@ then the breakpoint name. In simple words the class name will be like this zust-visible@breakpoint-name.

I'm only visible at small breakpoint

<p class="zust-hidden zust-visible@small">I'm only visible at small breakpoint</p>

zust-hide and zust-invisible applies in the same way.

Display types

You can also change the display type by adding any of these classes

Display types in different breakpoint

Display type has support for Breakpoints.

Its class name's structure will be like this display-type@breakpoint-name.

Example. If you want to make an element's display type to list-item only in small breakpoint then you will add class zust-list-item@small.

I am a list item only at small breakpoint.

<p class="zust-list-item@small">I am a list item only at small breakpoint.</p>


Margin and padding

For utilities there are margin and padding control. add any of these classes

Disabling margin or padding

You can also trigger marginless or paddingless in any defined breakpoint, because it has support for Breakpoints.

I've 4rem margin by default. But I will be marginless until large breakpoint.

<p class="zust-m-4 zust-marginless@until-large">I've 4rem margin by default. But I will be marginless until large breakpoint.</p>

Adding margins

You can also add margin to a element. You have to just add a class and the class's prefix is zust-m- then the value. The value is limited from 0 to 10, and it uses rem as unit.

Example. If you add class zust-m-1 to an element, the element's margin will be 1rem all sides.

Defining side in margin: You can define side for margin too. Use any of these prefixes

Example. If you want to add 2rem margin to top side, you will add class zust-m-t-2.

Adding paddings

Adding padding is same as margin just -m- will be replaced with -p-. Though I will cover it again.

Adding padding to a element is super easy. You have to just add a class and the class's prefix is zust-p- then the value. The value is limited from 0 to 10, and it uses rem as unit.

Example. If you add class zust-p-3 to an element, the element's margin will be 3rem all sides.

Defining side in padding: You can define side for padding too. Use any of these prefixes

Example. If you want to add 1rem padding to left side, you will add class zust-p-l-1.


Float

Change float just by adding class. zust-left for changing float to left. zust-right for changing float to right.

You can use class zust-clearfix for clearing floats of an item.

Without clearfix

Clearfix clears floats of an element, floats are designed for paragraphs to control image.

As you can see the image is going out of its container.



With clearfix

Clearfix clears floats of an element, floats are designed for paragraphs to control image.

Now it takes space from its container

<p>Without clearfix</p>
<div class='zust-bg-light'>
  <p>Clearfix clears floats of an element, floats are designed for paragraphs to control image.</p>
  <img class='zust-right' src='/resources/zusty.svg' width='80px'>
</div>
<p>As you can see the image is going out of its container.</p>
<br><br>

<p>With clearfix</p>
<div class='zust-clearfix zust-bg-light'>
  <p>Clearfix clears floats of an element, floats are designed for paragraphs to control image.</p>
  <img class='zust-right' src='/resources/zusty.svg' width='80px'>
</div>
<p>Now it takes space from its container</p>


Flexbox

Utility classes for working with flexbox.

If you want to learn more about Flexbox then Read This.

Justify

Align

Direction

Wrap

Grow

Set flex-grow by using class zust-grow-grow-size. Sizes are from 0 to 10.

Example - If you want to set flex-grow to 5 then you will use class zust-grow-5.


Flip

Flip any element. Useful for flipping images and icons.


Rotate

Rotate anything to predefined values. The values are 15, -15, 30, -30, 45, -45, 60, -60, 90, -90, 120, -120, 180, -180.

Use them just by adding class zust-rotate- and then the value.

Example 1 - If you want to rotate something to 120 deg, just add class zust-rotate-120. The element will be rotated 120 deg.

Example 2 - If you want to rotate something to -90 deg, just add class zust-rotate--90. The element will be rotated -90 deg.


Shape

There are several class which can help you change shape


State

You can toggle any element's state by adding class zust-hovered, zust-focused and zust-active. It's good for debugging and/or toggling states using JavaScript.

<button class="zust-btn zust-success">I'm being Tested</button>


Static

You can make any item static or unresponsive by adding class zust-static.



<button class="zust-btn zust-link">I'm responsive :]</button>
<button class="zust-btn zust-link zust-static">I'm unresponsive :[</button>
<br><br>

<p class="zust-form-el">
  <input class="zust-input" placeholder="I will respond :D">
</p>
<p class="zust-form-el">
  <input class="zust-input zust-static" placeholder="I will not respond ;_;">
</p>

checkSuccessfully Copied

Get involved in improving Zusty CSS.

Report a BugFeature Request

Support us by

Starring it on GitHubJoining our Discord ServerSharing on Twitter

Rapid Search Inside of Docs