Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

DelphiLibSass

Delphi wrapper for LibSass

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

DelphiLibSass

DelphiLibSass is Delphi wrapper around libsass a C/C++ implementation of a Sass compiler.

Based on the version of libsass 3.4.5 http://libsass.org

Source at github https://github.com/sass/libsass

https://github.com/sass/libsass/blob/master/docs/api-doc.md

Support

  • Delphi 2009 to Delphi 10.2

Usage

DelphiLibSass API is simply composed of a main TDelphiLibSass class

TDelphiLibSass.ConvertToCss converts a SCSS string to a CSS

pascal
Try
  FDelphiLibSass := TDelphiLibSass.Create('libsass.dll');
  FDelphiLibSass.LoadDLL;

  FScssResult := FDelphiLibSass.ConvertToCss('$font-stack: Helvetica, sans-serif; body { font: 100% $font-stack; }');

  writeln(FScssResult.CSS);
Finally
  FScssResult.Free;
  FDelphiLibSass.Free; 
end;

TDelphiLibSass.ConvertFileToCss converts a SCSS file to a CSS

pascal
Try
  FDelphiLibSass := TDelphiLibSass.Create('libsass.dll');
  FDelphiLibSass.LoadDLL;

  FScssResult := FDelphiLibSass.ConvertFileToCss('test.scss');

  writeln(FScssResult.CSS);
Finally
  FScssResult.Free;
  FDelphiLibSass.Free; 
end;

Sample

Basic example on how to use the Delphi wrapper

https://github.com/novuslogic/DelphiLibSass/tree/master/Sample

Packages

  • Support for Runtime Packages Delphi 2009 to Delphi 10.2

Known Issues

  • sass_context_get_included_files buffer overflows within Delphi.

ToDo

  • To add the TSass_Option class.