Open In App

Primer CSS Details Custom Caret

Last Updated : 06 May, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, and BEM architecture. It is highly reusable and flexible. It is created with GitHub’s design system.

Primer CSS Details Custom Caret is used to create the custom caret to show the hidden information using the details-reset class. We can add the dropdown icon to the right of the text. In this article, we will discuss Primer CSS Details Custom Caret.

Primer CSS Details Custom Caret Classes:

  • details-reset: This class is used to create the custom caret.
  • dropdown-caret: This class is used to create the dropdown icon.

Syntax:

<details class="details-reset">
  <summary class="btn">
       ...
  </summary>
  <div class="border p-3 mt-2">
       ...
  </div>
</details>

Example 1: This example demonstrates the implementation of Primer CSS Details Custom Caret to show the hidden text.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title> Primer CSS Details Custom Caret </title>
    <link rel="stylesheet" href=
"https://unpkg.com/@primer/css@^18.0.0/dist/primer.css" />
</head>
  
<body>
    <div class="text-center">
        <h1 class="color-fg-success"
            GeeksforGeeks 
        </h1>
        <h3
            Primer CSS Details Custom Caret 
        </h3> <br>
  
        <details class="details-reset">
            <summary class="btn">
                Show
            </summary>
            <div class="border p-3 mt-2">
                <h4> Welcome to GeeksforGeeks </h4>
                <p> A Computer Science portal for geeks. </p>
            </div>
        </details>
    </div>
</body>
  
</html>


Output:

 

Example 2: This example demonstrates the implementation of Primer CSS Details Custom Caret to show the hidden image.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title> Primer CSS Details Custom Caret </title>
    <link rel="stylesheet" href=
"https://unpkg.com/@primer/css@^18.0.0/dist/primer.css" />
</head>
  
<body>
    <div class="text-center">
        <h1 class="color-fg-success"
            GeeksforGeeks 
        </h1>
        <h3
            Primer CSS Details Custom Caret 
        </h3> <br>
  
        <details class="details-reset">
            <summary class="btn">
                Show
            </summary>
            <div class="border p-3 mt-2">
                <h4> GeeksforGeeks </h4>
                <img src=
            </div>
        </details>
    </div>
</body>
  
</html>


Output:

 

Reference: https://primer.style/css/utilities/details#custom-caret



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads