Justify Self
Controls the alignment of a single grid element relative to its inline axis.
Class | Properties |
---|---|
js-auto | justify-self: auto; |
js-c | justify-self: center; |
js-e | justify-self: end; |
js-s | justify-self: start; |
js-st | justify-self: stretch; |
Auto
This example sets the justify self to auto. The item will use the default alignment based on the container’s alignment properties.
<div class="p-r"> <div class="stripes d-g g-4 gtc-3 js-auto tc-white"> <div class="ai-c bg-indigo d-f dim-14 jc-c rad-1">A</div> <div class="ai-c bg-indigo d-f dim-14 jc-c rad-1">B</div> <div class="ai-c bg-indigo d-f dim-14 jc-c rad-1">C</div> </div></div>
Center
This example sets the justify self to center. The item will be centered within its grid area along the inline axis.
<div class="p-r"> <div class="stripes d-g g-4 gtc-3 js-c tc-white"> <div class="ai-c bg-indigo d-f dim-14 jc-c rad-1">A</div> <div class="ai-c bg-indigo d-f dim-14 jc-c rad-1">B</div> <div class="ai-c bg-indigo d-f dim-14 jc-c rad-1">C</div> </div></div>
End
This example sets the justify self to end. The item will be aligned to the end of its grid area along the inline axis.
<div class="p-r"> <div class="stripes d-g g-4 gtc-3 tc-white"> <div class="ai-c bg-indigo d-f dim-14 js-e rad-1">A</div> <div class="ai-c bg-indigo d-f dim-14 js-e rad-1">B</div> <div class="ai-c bg-indigo d-f dim-14 js-e rad-1">C</div> </div></div>
Start
This example sets the justify self to start. The item will be aligned to the start of its grid area along the inline axis.
<div class="p-r"> <div class="stripes d-g g-4 gtc-3 js-s tc-white"> <div class="ai-c bg-indigo d-f dim-14 jc-c rad-1">A</div> <div class="ai-c bg-indigo d-f dim-14 jc-c rad-1">B</div> <div class="ai-c bg-indigo d-f dim-14 jc-c rad-1">C</div> </div></div>
Stretch
This example sets the justify self to stretch. The item will stretch to fill its grid area along the inline axis.
<div class="p-r"> <div class="stripes d-g g-4 gtc-3 js-st tc-white"> <div class="ai-c bg-indigo d-f h-14 jc-c rad-1">A</div> <div class="ai-c bg-indigo d-f h-14 jc-c rad-1">B</div> <div class="ai-c bg-indigo d-f h-14 jc-c rad-1">C</div> </div></div>
Utilizing utilities conditionally
Override existing utilities based on the user's screen size or other factors, such as hover states. Learn more about modifiers in our documentation.
Responsive breakpoints
You can combine responsive breakpoints like sm:js-*
,md:js-*
, lg:js-*
, and xxl:js-*
allows targeting specific utilities in
different viewports.
<div class="js-s md:js-e ..."></div>
Utilizing utilities conditionally
Override existing utilities based on the user's screen size or other factors, such as hover states. Learn more about modifiers in our documentation.
Hover states
Alternatively, you can apply :hover
by using h:js-*
utility to override elements
and change their values when hovering over them.
<div class="js-s h:js-e ..."></div>