{"id":20597217,"url":"https://github.com/cathive/sass-java","last_synced_at":"2025-04-15T00:08:35.585Z","repository":{"id":24853327,"uuid":"28268513","full_name":"cathive/sass-java","owner":"cathive","description":"Libsass for Java","archived":false,"fork":false,"pushed_at":"2016-06-13T14:52:23.000Z","size":10317,"stargazers_count":18,"open_issues_count":7,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T00:08:23.955Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cathive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-20T14:02:25.000Z","updated_at":"2020-09-17T13:03:50.000Z","dependencies_parsed_at":"2022-07-10T11:30:35.936Z","dependency_job_id":null,"html_url":"https://github.com/cathive/sass-java","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cathive%2Fsass-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cathive%2Fsass-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cathive%2Fsass-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cathive%2Fsass-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cathive","download_url":"https://codeload.github.com/cathive/sass-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981267,"owners_count":21193147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T08:21:11.334Z","updated_at":"2025-04-15T00:08:35.568Z","avatar_url":"https://github.com/cathive.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"libsass for Java\n================\n\nA [JNA](https://github.com/twall/jna) binding to access [libsass](http://libsass.org/) functionality.\n\nA compiled and ready-to-use version of this library can be found in the in the [Maven Central repository](http://search.maven.org/#browse%7C1800775426).\nTo use the library in your Maven based projects just add the following lines to your\n'pom.xml':\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.cathive.sass\u003c/groupId\u003e\n  \u003cartifactId\u003esass-java\u003c/artifactId\u003e\n  \u003cversion\u003e${sass-java.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Versions\n\nlibsass for Java uses [Semantic Versioning](http://www.semver.org/).\nMAJOR, MINOR and PATCH version are used for the library / Java binding itself.\nThe BUILD METADATA component of the version is used to describe to version of the\nunderlying native C/C++ libsass component.\n\n## Native libraries\n\nCompiled dynamic libraries of libsass are bundled inside of the JAR artifact together with the required auto-generated JNA binding classes and nice wrapper classes to allow for a Java-like feeling when working with libsass.\n\n### Supported platforms\n\nThis is the list of platforms that are directly supported, because the dynamic library has been pre-compiled and bundled:\n\n- [ ] Linux x86-64\n- [ ] Linux x86\n- [ ] Mac OS X x86-64\n- [ ] Windows x86-64\n- [ ] Windows x86\n\nIf your desired platform / architecture is missing, feel free to open an issue and add a pre-compiled version of libsass for inclusion!\n\n## Example code\n\n```java\nimport com.cathive.sass.SassCompilationException;\nimport com.cathive.sass.SassContext;\nimport com.cathive.sass.SassFileContext;\nimport com.cathive.sass.SassOptions;\nimport com.cathive.sass.SassOutputStyle;\n\nimport java.io.IOException;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\n\n/**\n * A little example to demonstrate some of the features of sass-java.\n */\nclass SimpleSassExample {\n\n    public static void main(String... args) {\n\n        // Our root directory that contains the\n        Path srcRoot = Paths.get(\"/path/to/my/scss/files\");\n\n        // Creates a new sass file context.\n        SassContext ctx = SassFileContext.create(srcRoot.resolve(\"styles.scss\"));\n\n        SassOptions options = ctx.getOptions();\n        options.setIncludePath(\n                srcRoot,\n                Paths.get(\"/another/include/directory\"),\n                Paths.get(\"/and/yet/another/include/directory\")\n                //[...] varargs can be passed to add even more include directories.\n        );\n        options.setOutputStyle(SassOutputStyle.NESTED);\n        // any other options supported by libsass including source map stuff can be configured\n        // as well here.\n\n        // Will print the compiled CSS contents to the console. Use a FileOutputStream\n        // or some other fancy mechanism to redirect the output to wherever you want.\n        try {\n            ctx.compile(System.out);\n        } catch (SassCompilationException e) {\n            // Will print the error code, filename, line, column and the message provided\n            // by libsass to the standard error output.\n            System.err.println(e.getMessage());\n        } catch (IOException e) {\n            System.err.println(String.format(\"Compilation failed: %s\", e.getMessage()));\n        }\n    }\n\n}\n```\n## Ant Task Example\n\nThis example shows how to invoke sass-java from Ant using the bundled Ant task and the maven-antrun-plugin.\n\n```xml\n\u003cplugin\u003e\n    \u003cartifactId\u003emaven-antrun-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e1.7\u003c/version\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cphase\u003egenerate-sources\u003c/phase\u003e\n            \u003cconfiguration\u003e\n                \u003ctarget\u003e\n                    \u003cpath id=\"plugin.classpath\"\u003e\n                        \u003cpath path=\"${maven.plugin.classpath}\"/\u003e\n                    \u003c/path\u003e\n                    \u003ctaskdef name=\"sass\" classname=\"com.cathive.sass.SassTask\" classpathref=\"plugin.classpath\"/\u003e\n                    \u003cdelete dir=\"${output.dir}\"/\u003e\n                    \u003csass in=\"${sass.srcdir}\" outdir=\"${output.dir}\"\u003e\n                        \u003c!--\n                            Note that the task takes a nested `path` element to reference any Sass include directories.\n                        --\u003e\n                        \u003cpath\u003e\n                            \u003cpathelement location=\"${include1.dir}\"/\u003e\n                            \u003cpathelement location=\"${include2.dir}\"/\u003e\n                        \u003c/path\u003e\n                    \u003c/sass\u003e\n                \u003c/target\u003e\n            \u003c/configuration\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003erun\u003c/goal\u003e\n            \u003c/goals\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ecom.cathive.sass\u003c/groupId\u003e\n            \u003cartifactId\u003esass-java\u003c/artifactId\u003e\n            \u003cversion\u003e${sass-java.version}\u003c/version\u003e\n        \u003c/dependency\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.apache.ant\u003c/groupId\u003e\n            \u003cartifactId\u003eant\u003c/artifactId\u003e\n            \u003cversion\u003e1.9.6\u003c/version\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n\u003c/plugin\u003e\n```\n\n### Ant Task Attributes\n`in` (Path to a directory that contains scss files or a single scss file)\n\n`outdir` (Directory path where the compiled css should be placed)\n\n`precision` (number)\n\n`outputstyle` (0 = nested, 1 = expanded, 2 = compact, 3 = compressed)\n\n`sourcecomments` (true/false)\n\n`sourcemapembed` (true/false)\n\n`sourcemapcontents` (true/false)\n\n`omitsourcemapurl` (true/false)\n\n`isindentedsyntaxsrc` (true/false)\n\n`sourcemapfile` (Path to source map file)\n\n`sourcemaproot` (Directly inserted in source maps)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcathive%2Fsass-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcathive%2Fsass-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcathive%2Fsass-java/lists"}