{"id":23893346,"url":"https://github.com/sumpygump/kss-php","last_synced_at":"2025-04-10T12:51:58.281Z","repository":{"id":6706057,"uuid":"7951577","full_name":"sumpygump/kss-php","owner":"sumpygump","description":"A PHP Implementation of KSS: a methodology for documenting CSS and generating styleguides","archived":false,"fork":false,"pushed_at":"2013-02-05T01:05:38.000Z","size":166,"stargazers_count":2,"open_issues_count":0,"forks_count":17,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T11:38:27.077Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":false,"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/sumpygump.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-01T04:07:42.000Z","updated_at":"2016-04-07T16:09:46.000Z","dependencies_parsed_at":"2022-08-20T04:50:07.148Z","dependency_job_id":null,"html_url":"https://github.com/sumpygump/kss-php","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumpygump%2Fkss-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumpygump%2Fkss-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumpygump%2Fkss-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumpygump%2Fkss-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sumpygump","download_url":"https://codeload.github.com/sumpygump/kss-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248220304,"owners_count":21067280,"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":"2025-01-04T14:17:50.502Z","updated_at":"2025-04-10T12:51:58.259Z","avatar_url":"https://github.com/sumpygump.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Knyle Style Sheets\n\nThis is a PHP implementation of [Knyle Style Sheets](http://warpspire.com/kss) (KSS).\nKSS attempts to provide a methodology for writing maintainable, documented CSS\nwithin a team. Specifically, KSS is a documentation specification and styleguide\nformat. It is **not** a preprocessor, CSS framework, naming convention, or\nspecificity guideline.\n\n* **[The Spec (What KSS is)](https://github.com/kneath/kss/blob/master/SPEC.md)**\n* **[Example living styleguide](https://github.com/scaninc/kss-php/tree/master/example)**\n\n## KSS in a nutshell\n\nThe methodology and ideas behind Knyle Style Sheets are contained in [SPEC.md](https://github.com/kneath/kss/blob/master/SPEC.md)\nof the origin [ruby version](https://github.com/kneath/kss) of KSS. At its core,\nKSS is a documenting syntax for CSS.\n\n```css\n/*\n# Star Button\n\nA button suitable for giving stars to someone.\n\nMarkup: \u003ca class=\"button star $modifierClass\"\u003eButton\u003c/a\u003e\n\n:hover              - Subtle hover highlight.\n.stars--given       - A highlight indicating you've already given a star.\n.stars--given:hover - Subtle hover highlight on top of stars-given styling.\n.stars--disabled    - Dims the button to indicate it cannot be used.\n\nStyleguide 2.1.3.\n*/\na.button.star {\n  ...\n}\na.button.star:hover {\n  ...\n}\na.button.stars--given {\n  ...\n}\na.button.stars--given:hover {\n  ...\n}\na.button.stars--disabled {\n  ...\n}\n```\n\n## PHP Library\n\nThis repository includes a php library suitable for parsing SASS, SCSS, and CSS\ndocumented with KSS guidelines. To use the library, include it in your project as\na composer dependency (see below). Then, create a parser and explore your KSS.\n\n```php\n\u003c?php\n\nrequire_once('../vendors/autoload.php');\n$styleguide = new \\Scan\\Kss\\Parser('public/stylesheets')\n\n$section = $styleguide-\u003egetSection('2.1.1');\n// Returns a \\Scan\\Kss\\Section object\n\necho $section-\u003egetTitle();\n// Echoes \"Star Button\"\n\necho $section-\u003egetDescription();\n// echoes \"A button suitable for giving stars to someone.\"\n\necho $section-\u003egetMarkup();\n// echoes \"\u003ca class=\"button star $modifierClass\"\u003eButton\u003c/a\u003e\"\n\n$modifier = current($section-\u003egetModifiers());\n// Returns a \\Scan\\Kss\\Modifier object\n\necho $modifier-\u003egetName();\n// echoes ':hover'\n\necho $modifier-\u003egetClassName();\n// echoes 'psuedo-class-hover'\n\necho $modifier-\u003egetDescription();\n// echoes 'Subtle hover highlight'\n\necho $modifier-\u003egetExampleHtml();\n// echoes \u003ca class=\"button stars stars-given\"\u003eButton\u003c/a\u003e for the .stars-given modifier\n```\n\n## Generating styleguides\n\nThe documenting syntax and php library are intended to generate styleguides automatically.\nTo do this, you'll need to leverage a small javascript library that generates\nclass styles for pseudo-class styles (`:hover`, `:disabled`, etc).\n\n* [kss.coffee](https://github.com/scaninc/kss-php/blob/master/lib/Scan/kss.coffee)\n* [kss.js](https://github.com/scaninc/kss-php/blob/master/example/public/js/kss.js) (compiled js)\n\nFor an example of how to generate a styleguide, check out the [`example`](https://github.com/scaninc/kss-php/tree/master/example)\nphp pages.\n\n## Dependencies\n\nThe PHP version of KSS has dependencies managed by Composer. If you did not install\nkss-php using composer, you must install these dependencies manually before using\nthe library by running the following commands:\n\n```\n$ composer install\n```\n\nIf you do not yet have Composer, download it following the instructions on\nhttp://getcomposer.org or run the following commands to install it globally on\nyour system:\n\n```\n$ curl -s https://getcomposer.org/installer | php\n$ sudo mv composer.phar /usr/local/bin/composer\n```\n\n## Symfony2 Bundle\n\nIf your project uses [symfony2](http://symfony.com/), consider using the [KSS Bundle]\n(https://github.com/scaninc/ScanKssBundle) as well. The KSS Bundle uses Twig templates\nto make the styleguide block easier to customize and include in your views.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumpygump%2Fkss-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsumpygump%2Fkss-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumpygump%2Fkss-php/lists"}