{"id":15465906,"url":"https://github.com/vasfed/csso-rails","last_synced_at":"2025-04-05T20:06:11.503Z","repository":{"id":2422325,"uuid":"3390980","full_name":"Vasfed/csso-rails","owner":"Vasfed","description":"CSS Optimizer(csso) ruby wrapper for Rails Asset pipeline","archived":false,"fork":false,"pushed_at":"2024-04-11T19:00:58.000Z","size":478,"stargazers_count":90,"open_issues_count":4,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T18:08:43.681Z","etag":null,"topics":["asset-pipeline","compression","css","csso","optimization","rails","rails-asset-pipeline"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vasfed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2012-02-08T20:24:55.000Z","updated_at":"2024-03-22T07:33:46.000Z","dependencies_parsed_at":"2024-06-18T18:37:19.486Z","dependency_job_id":"bd08bf66-55dc-4e30-917b-ac45134b2ed8","html_url":"https://github.com/Vasfed/csso-rails","commit_stats":{"total_commits":88,"total_committers":7,"mean_commits":"12.571428571428571","dds":"0.23863636363636365","last_synced_commit":"afa08afd4df473ae02e8488a815cbb66b02fe600"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vasfed%2Fcsso-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vasfed%2Fcsso-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vasfed%2Fcsso-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vasfed%2Fcsso-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vasfed","download_url":"https://codeload.github.com/Vasfed/csso-rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393568,"owners_count":20931812,"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":["asset-pipeline","compression","css","csso","optimization","rails","rails-asset-pipeline"],"created_at":"2024-10-02T01:04:09.065Z","updated_at":"2025-04-05T20:06:11.473Z","avatar_url":"https://github.com/Vasfed.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csso-rails: Stylesheet Optimizer (CSSO) for Rails Asset pipeline\n\n[![Gem Version](https://badge.fury.io/rb/csso-rails.svg)](https://badge.fury.io/rb/csso-rails)\n![CI Status](https://github.com/Vasfed/csso-rails/actions/workflows/test.yml/badge.svg)\n\nRuby adapter for [github.com/css/csso](https://github.com/css/csso).\n\nCSSO does structure-optimization for CSS.\nCSS is usually reduced more than in half in uncompressed and around 15% in gzipped.\n\n### A Real-World Example\nA living rails application CSS – some written in less, some handwritten):\n\n|        | Original     |  sass  | yui 2.4.7  | csso  | % of original\n|:-------|:------------:|:------:|:-----:|:-----:|:------:\n|Plain   | 129497       | 107006 | 60758 | 60874 | 47%\n|GZipped | 14046        | 12047  | 10558 | 10472 | 74%\n\nVery close to yui compressor, wining in gzipped (you’re using nginx `mod\\_gzip_static`, don’t you?)\n\nA more hard example – twitter bootstrap.css, already minified:\n\n|        | Original     | lessc | yui 2.4.7  | csso  | % of original\n|:-------|:------------:|:-----:|:-----:|:-----:|:------:\n|Plain   | 81443        | 71520 | 68755 | 67679 | 83%\n|GZipped | 12384        | 11633 | 11652 | 11477 | 92%\n\nPlease note than benchmark was taken in summer of 2012, since then things may have changed.\n\n## Usage\n\n### In Rails 3.1+\n\nAdd `gem 'csso-rails'` to your gemfile, and that’s it!\n(also you may want to add some javascript runtime for ExecJS to pick up, like `gem 'therubyracer'`)\n\nUpon including it becomes the default compressor even if sass is included too.\nMore explicit way – set in `config/environment/production.rb`:\n\n```ruby\nconfig.assets.css_compressor = :csso\n```\n\n### Sprockets\n\nIf you use Sprockets without Rails:\n\n```ruby\nrequire 'csso'\nCsso.install(sprockets_env)\n```\n\n### In Plain Ruby\n\n```ruby\nrequire 'csso'\nputs Csso.optimize(\"a{ color: #FF0000; }\") # produces \"a{color:red}\"\n```\n\nIn _maniac mode_ (`Csso.optimize(css, true)`, default for pipeline) CSS is processed several times until it stops getting lighter (there're cases when original csso does not do all optimizations for no reason).\n\n### In Command Line\n\n    ruby_csso non_optimized.css \u003e optimized.css\n\n\n## MIT-License\n\n\u003e Original CSSO code - Copyright (C) 2011 by Sergey Kryzhanovsky.\n\u003e\n\u003e ruby gem - Copyright(C) 2012 Vasily Fedoseyev\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasfed%2Fcsso-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvasfed%2Fcsso-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasfed%2Fcsso-rails/lists"}