Spectre CSS is a lightweight, responsive, and modern CSS framework that allows for speedier development and extensibility. It provides the essential elements and typographic stylings, as well as a responsive layout system based on the flexbox feature. It was created by Yan Zhu and first introduced in March 2016.
Spectre CSS
Spectre is a side project born out of years of CSS development on a huge web service. Only modern base styles, responsive layout systems, CSS components, and utilities are included in Spectre, which may be customized for your project using the Sass/Scss compiler. The use of Spectre.css is absolutely free.
Spectre CSS
Features of Spectre CSS:
- Lightweight: Spectre CSS is a lightweight CSS framework. All sets of modules are packed in less than 10kb gzipped files.
- Responsive: Spectre CSS is a completely responsive framework. It provides the essential elements and typographic stylings, as well as a responsive layout system based on the flexbox feature.
- Modern CSS Framework: Spectre CSS is a modern CSS framework that allows for speedier development and extensibility
- Open Source
The next step in learning Spectre CSS involves its installation: There are five ways to install Spectre CSS that are described below:
Method 1 (Install Manually): We can easily download the compiled and minified Spectre CSS file from the given link. The file size will be approx 10Kb.
https://github.com/picturepan2/spectre/releases
After downloading the files, put the file in your current working folder and navigate the useful files like spectre.min.css, spectre-exp.min.css & spectre-icons.min.css. This will enable spectre on your working folder. Then, specify those file path links to your code.
<link rel="stylesheet" href="spectre.min.css">
<link rel="stylesheet" href="spectre-exp.min.css">
<link rel="stylesheet" href="spectre-icons.min.css">
Method 2 (Install from CDN): We can simply use the below-mentioned links in the head section of our HTML file that will enable Spectre.
<link rel=”stylesheet” href=”https://unpkg.com/[email protected]/dist/spectre.min.css%E2%80%9D>
<link rel=”stylesheet” href=”https://unpkg.com/[email protected]/dist/spectre-exp.min.css%E2%80%9D>
<link rel=”stylesheet” href=”https://unpkg.com/[email protected]/dist/spectre-icons.min.css%E2%80%9D>
Method 3 (Install with NPM): To install Spectre, we just need to run the below command after that we need to navigate the required file in our HTML file.
npm install spectre.css --save
Method 4 (Install with Yarn): To install Spectre, we just need to run the below command after that we need to navigate the required file in our HTML file.
yarn add spectre.css
Method 5 (Install from Bower): We can install Spectre from the bower. This method for installing the Spectre is not preferred & avoided.
bower install spectre.css --save
Example: In this example, we will use the heading classes provided by Spectre CSS.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
content="width=device-width, initial-scale=1.0">
<link rel="stylesheet"
href=
"https://unpkg.com/[email protected]/dist/spectre.min.css">
<link rel="stylesheet"
href=
"https://unpkg.com/[email protected]/dist/spectre-exp.min.css">
<link rel="stylesheet"
href=
"https://unpkg.com/[email protected]/dist/spectre-icons.min.css">
<title>Spectre CSS</title>
</head>
<body>
<center>
<h1 class="text-success">GeeksforGeeks</h1>
<strong>SPECTRE CSS</strong>
<br><br>
<div>
<span class="h2">Geeks for Geeks
<span class="h6">is a great place to learn
<span class="h4">Spectre CSS
</div>
</center>
</body>
</html>
Output:
Spectre CSS
Benefits of Spectre CSS: Modern basic styles, a responsive layout system, CSS components, and utilities are all included in Spectre CSS, which may be customized for your project using the Sass/Scss compiler. Spectre CSS is easy to implement framework. It is easy to use the responsive design with a modern approach with flexbox.
Learn more about Spectre CSS:
Spectre CSS Complete References:
Alternatives of Spectre CSS:
- Bootstrap 5: Bootstrap is a free and open-source collection of CSS and JavaScript/jQuery code used for creating dynamic websites layout and web applications. Bootstrap is one of the most popular front-end frameworks which has a nice set of predefined CSS codes.
- Tailwind CSS: Tailwind CSS is basically a Utility first CSS framework for building rapid custom UI. It is a highly customizable, low-level CSS framework that gives you all of the building blocks that you need.
- Materialize CSS: Materialize CSS is a design language that combines the classic principles of successful design along with innovation and technology. It is created and designed by Google. Google’s goal is to develop a system of design that allows for a unified user experience across all its products on any platform.
Recent articles Spectre CSS
Similar Reads
CSS Tutorial CSS stands for Cascading Style Sheets. It is a stylesheet language used to style and enhance website presentation. CSS is one of the three main components of a webpage, along with HTML and JavaScript.HTML adds Structure to a web page.JavaScript adds logic to it and CSS makes it visually appealing or
7 min read
CSS Introduction CSS (Cascading Style Sheets) is a language designed to simplify the process of making web pages presentable.It allows you to apply styles to HTML documents by prescribing colors, fonts, spacing, and positioning.The main advantages are the separation of content (in HTML) and styling (in CSS) and the
4 min read
CSS Syntax CSS is written as a rule set, which consists of a selector and a declaration block. The basic syntax of CSS is as follows:The selector is a targeted HTML element or elements to which we have to apply styling.The Declaration Block or " { } " is a block in which we write our CSS.HTML<html> <h
2 min read
CSS Selectors CSS Selectors are used to target HTML elements on your pages, allowing you to apply styles based on their ID, class, type attributes, and more. There are mainly 5 types of selectors.Basic CSS Selectors: These are used to target elements by tag, .class, or # ID for fundamental styling needs.Combinato
7 min read
CSS Comments CSS comments are used to add notes or explanations to your code, helping you and others understand it better. They start with /* and end with */ and can be used for both single-line and multi-line comments. Note: Comments are ignored by browsers, so they wonât affect how your webpage looks or works.
2 min read
CSS Colors CSS colors are used to set the color of different parts of a webpage, like text, background, and borders. This helps make the page look more attractive and easier to read. You can define colors using names, hex codes, RGB values, and more.You can try different formats of colors here- #content-iframe
5 min read
CSS Borders Borders in CSS are used to create a visible outline around an element. They can be customized in terms ofWidth: The thickness of the border.Style: The appearance of the border (solid, dashed, dotted, etc.).Color: The color of the border.You can try different types of borders here- #custom-iframe{ he
5 min read
CSS Margins CSS margins are used to create space around an element, separating it from neighboring elements and the edges of the webpage. They control the layout by adjusting the distance between elements, providing better organization and readability.Syntax:body { margin: value;}HTML<html> <head>
4 min read
CSS Height and Width Height and Width in CSS are used to set the height and width of boxes. Their values can be set using length, percentage, or auto.Width and HeightThe width and height properties in CSS are used to define the dimensions of an element. The values can be set in various units, such as pixels (px), centim
4 min read
CSS Outline CSS outline is a property used to draw a line around an element's border. It does not affect the layout, unlike borders. It's often used to highlight elements, providing a visual emphasis without altering the dimensions of the element.Syntaxselector{ outline: outline-width outline-type outline-color
4 min read