GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - peracto/DotNetCSS: A CSS Parser for .NET

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

52 Commits
52 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
DotNetCSS.sln
DotNetCSS.sln
 
 
appveyor.yml
appveyor.yml
 
 
license.txt
license.txt
 
 
readme.md
readme.md
 
 
version.json
version.json
 
 

Repository files navigation

DotNetCSS StyleSheet Parser for .NET

Build status NuGet

Overview

DotNetCSS is a continuation of the ExCSS CSS parser project. The orignal project appears to no longer take pull requests, and so this project was created to pick up where ExCSS version 3.0 left off. DotNetCSS is a .NET implementation of a CSS 2.1 and CSS 3 lexer and parser intended to provide an easy-to-use CSS object model.

Installation

DotNetCSS can be installed from the Visual Studio NuGet Package Manager, or from the NuGet Package Manager Console:

Install-Package DotNetCSS

Or, use your favorite package management tool (.NET CLI, Paket CLI, etc).

A basic example

using DotNetCSS;
using System;
using System.Linq;

namespace SampleDotNetCSS
{
    class Program
    {
        static void Main(string[] args)
        {
            var parser = new StylesheetParser();
            var stylesheet = parser.Parse(".someClass{color: red; background-image: url('/images/logo.png')");
            var rule = stylesheet.StyleRules.First();

            Console.WriteLine($"Selector is {rule.Selector.Text}"); // Selector is .someClass
            Console.WriteLine($"Color is {rule.Style.Color}"); // Color is rgb(255, 0, 0)
            Console.WriteLine($"BackgroundImage is {rule.Style.BackgroundImage}"); // BackgroundImage is url('/images/logo.png')

            Console.WriteLine("\nPress any key to exit...");
            Console.ReadKey();
        }
    }
}

About

A CSS Parser for .NET

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.