{"id":13411338,"url":"https://github.com/yosssi/gcss","last_synced_at":"2025-03-14T17:30:40.791Z","repository":{"id":20390346,"uuid":"23666134","full_name":"yosssi/gcss","owner":"yosssi","description":"Pure Go CSS Preprocessor","archived":false,"fork":false,"pushed_at":"2024-03-06T12:41:55.000Z","size":668,"stargazers_count":494,"open_issues_count":10,"forks_count":40,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-07-31T20:45:33.915Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yosssi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-09-04T14:38:20.000Z","updated_at":"2024-07-24T02:17:08.000Z","dependencies_parsed_at":"2024-06-18T13:57:40.276Z","dependency_job_id":null,"html_url":"https://github.com/yosssi/gcss","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yosssi%2Fgcss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yosssi%2Fgcss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yosssi%2Fgcss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yosssi%2Fgcss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yosssi","download_url":"https://codeload.github.com/yosssi/gcss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243618597,"owners_count":20320264,"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-07-30T20:01:13.004Z","updated_at":"2025-03-14T17:30:40.522Z","avatar_url":"https://github.com/yosssi.png","language":"Go","readme":"# GCSS - Pure Go CSS Preprocessor\n\n[![wercker status](https://app.wercker.com/status/4857161fd705e6c43df492e6a33ce87f/m \"wercker status\")](https://app.wercker.com/project/bykey/4857161fd705e6c43df492e6a33ce87f)\n[![Build status](https://ci.appveyor.com/api/projects/status/ocbu6upgr3j0m3vc/branch/master)](https://ci.appveyor.com/project/yosssi/gcss/branch/master)\n[![Coverage Status](https://img.shields.io/coveralls/yosssi/gcss.svg)](https://coveralls.io/r/yosssi/gcss?branch=master)\n[![GoDoc](http://godoc.org/github.com/yosssi/gcss?status.svg)](http://godoc.org/github.com/yosssi/gcss)\n[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/yosssi/gcss?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\n## Overview\n\nGCSS is a pure Go CSS preprocessor. This is inspired by [Sass](http://sass-lang.com/) and [Stylus](http://learnboost.github.io/stylus/).\n\n## Syntax\n\n### Variables\n\n```scss\n$base-font: Helvetica, sans-serif\n$main-color: blue\n\nbody\n  font: 100% $base-font\n  color: $main-color\n```\n\n### Nesting\n\n```scss\nnav\n  ul\n    margin: 0\n    padding: 0\n\na\n  color: blue\n  \u0026:hover\n    color: red\n```\n\n### Mixins\n\n```scss\n$border-radius($radius)\n  -webkit-border-radius: $radius\n  -moz-border-radius: $radius\n  -ms-border-radius: $radius\n  border-radius: $radius\n\n.box\n  $border-radius(10px)\n```\n\n## Installation\n\n```sh\n$ go get -u github.com/yosssi/gcss/...\n```\n\n## Compile from the Command-Line\n\n```sh\n$ gcss /path/to/gcss/file\n```\n\nor\n\n```sh\n$ cat /path/to/gcss/file | gcss \u003e /path/to/css/file\n```\n\n## Compile from Go programs\n\nYou can compile a GCSS file from Go programs by invoking the `gcss.CompileFile` function.\n\n```go\ncssPath, err := gcss.CompileFile(\"path_to_gcss_file\")\n\nif err != nil {\n\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\treturn\n}\n\nhttp.ServeFile(w, r, cssPath)\n```\n\nYou can invoke the `gcss.Compile` function instead of the `gcss.CompileFile` function. The `gcss.Compile` function takes `io.Writer` and `io.Reader` as a parameter, compiles the GCSS data which is read from the `io.Reader` and writes the result CSS data to the `io.Writer`. Please see the [GoDoc](http://godoc.org/github.com/yosssi/gcss) for the details.\n\n```go\nf, err := os.Open(\"path_to_gcss_file\")\n\nif err != nil {\n\tpanic(err)\n}\n\ndefer func() {\n\tif err := f.Close(); err != nil {\n\t\tpanic(err)\n\t}\n}()\n\nn, err := gcss.Compile(os.Stdout, f)\n```\n\n## Documentation\n\n* [GoDoc](http://godoc.org/github.com/yosssi/gcss)\n\n## Syntax Highlightings\n\n* [vim-gcss](https://github.com/yosssi/vim-gcss) - Vim syntax highlighting for GCSS\n","funding_links":[],"categories":["CSS Preprocessors","CSS预处理","\u003cspan id=\"css预处理器-css-preprocessors\"\u003eCSS预处理器 CSS Preprocessors\u003c/span\u003e","预处理器","CSS预处理器","CSS 預處理器","CSS预处理`预处理css文件的库`","Uncategorized","CSS 预处理器"],"sub_categories":["Advanced Console UIs","标准 CLI","Standard CLI","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","标准CLI","高級控制台界面","高级控制台界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyosssi%2Fgcss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyosssi%2Fgcss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyosssi%2Fgcss/lists"}