Skip to content
This repository was archived by the owner on Jul 23, 2022. It is now read-only.

onurblt/CSSParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSSParser

a CSSParser(WIP) for C++ with CC0 license

  • Easy to use
  • Doesnt support selectors yet

Example

#include "StyleSheet.h"


int main()
{

    StyleSheet css;

    //load a CSS file
    css.readFile("examples/example1.css");
    
    //Or simply assign a CSS string
    css="h1 {color: #36CFFF; text-align: center;}  body {background-color: lightblue;} p {font-family: verdana;font-size:20px;}";

    
    //accessing
    std::cout<<css<<std::endl;
    std::cout<<css["h1"]<<std::endl;
    std::cout<<css["h1"]["color"]<<std::endl;
    std::cout<<css["p"]["font-size"]<<std::endl;

    //manipulating
    css["p"]["font-size"]="35px";
    std::cout<<css["p"]["font-size"]<<std::endl;

    //write to file
    css.writeFile("examples/out1.css");

    return 0;
}

About

a CSSParser for C++ with CC0 license

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published