![]() |
Primer CSS is a CSS framework that is built with the GitHub design system to provide support to enhance the development of websites. It is used to create the foundation of the basic style elements such as spacing, typography, and color. The systematic Primer CSS method ensures our patterns are steady and interoperable with every other. It is influenced by Object-Oriented CSS principles, functional CSS, and BEM architecture. It is a highly reusable model. Primer CSS facilitates the different designs to develop an attractive user interface with the help of GitHub’s design system which helps to enhance the overall user experience of the website. Benefits of using Prime CSS:
There are two different ways for using Primer CSS in your project:
npm -v OR npm --version You must have the npm version 3 or above to use the components, Utilities, etc. If you have older versions of npm, then use the below command to upgrade the npm version: npm install npm@latest -g You can follow the below steps for Installing Primer CSS: Step 1: You may use the below command to install the Primer CSS: npm install @primer/css --save This will help you to install all the required SCSS source files into the node_modules/@primer/CSS folder. Step 2: You can make use of the import keyword inside the <style> tag in the HTML file or we can create the stylesheet that will contain the below import statement and link the stylesheet with the <link> tag in the <head> tag of the HTML file. @import "node_modules/@primer/css/dist/primer.css"; Step 3: In the last step, you can add the classes of specific components/Utilities, as given below: <button class="BtnGroup-item btn" type="button">Button</button>
Example 1: In the below code, we will make use of the CDN link and create a primary button. HTML
Output: ![]()
Example 2: In this example, we have created a header and text of different sizes by using the different header and typography utility classes. HTML
Output: ![]()
Reference: https://primer.style/css/getting-started |
Reffered: https://www.geeksforgeeks.org
CSS |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 8 |