{"id":21954171,"url":"https://github.com/cssobj/cssobj-intro-clearfix","last_synced_at":"2026-04-12T17:34:28.683Z","repository":{"id":58219576,"uuid":"70983688","full_name":"cssobj/cssobj-intro-clearfix","owner":"cssobj","description":"cssobj intro to make css clearfix easier","archived":false,"fork":false,"pushed_at":"2016-10-19T06:41:49.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T03:04:33.725Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/cssobj.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}},"created_at":"2016-10-15T11:23:40.000Z","updated_at":"2016-10-15T16:06:37.000Z","dependencies_parsed_at":"2022-08-31T16:25:27.634Z","dependency_job_id":null,"html_url":"https://github.com/cssobj/cssobj-intro-clearfix","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssobj%2Fcssobj-intro-clearfix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssobj%2Fcssobj-intro-clearfix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssobj%2Fcssobj-intro-clearfix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssobj%2Fcssobj-intro-clearfix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cssobj","download_url":"https://codeload.github.com/cssobj/cssobj-intro-clearfix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245001905,"owners_count":20545332,"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-29T07:16:53.369Z","updated_at":"2025-10-12T17:46:20.085Z","avatar_url":"https://github.com/cssobj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cssobj-intro-clearfix\n\n[![Join the chat at https://gitter.im/css-in-js/cssobj](https://badges.gitter.im/css-in-js/cssobj.svg)](https://gitter.im/css-in-js/cssobj)\n\n[cssobj](https://github.com/cssobj/cssobj) intro to make clearfix easier. code from [The very latest clearfix reloaded][]\n\n[The very latest clearfix reloaded]: http://cssmojo.com/the-very-latest-clearfix-reloaded/\n\n## Install\n\n- npm\n\n```bash\nnpm install cssobj-intro-clearfix\n```\n\n- bower\n\n```bash\nbower install cssobj-intro-clearfix\n```\n\n## Usage\n\n- **basic usage**:\n\nWhen you need to put `'\u003cdiv class=\"clearfix nav\"\u003e'`, but don't remember the [clearfix hack][The very latest clearfix reloaded], or don't want to copy/paste, use this plugin as below:\n\n```javascript\nvar clearfix = require('cssobj-intro-clearfix')\n\ncssobj(\n  { '.nav': {color: 'red'} },\n  {\n    intros: [\n      clearfix()\n    ]\n  }\n)\n```\n\nresult css:\n\n``` css\n.clearfix:before,\n.clearfix:after {\n    content: \" \";\n    display: table;\n}\n.clearfix:after {\n    clear: both;\n}\n.clearfix {\n    *zoom: 1;\n}\n.nav {\n    color: red;\n}\n```\n\n- **use with [plugin-extend](https://github.com/cssobj/cssobj-plugin-extend)**\n\nSo your html can be as clean as: `'\u003cdiv class=\"nav\"\u003e'`, no need to write `clearfix` in your tag.\n\n```javascript\nvar clearfix = require('cssobj-intro-clearfix')\nvar pluginExtend = require('cssobj-plugin-extend')\n\ncssobj(\n  { '.nav': {color: 'red', $extend: /\\.clearfix\\b/} },\n  {\n    intros: [\n      clearfix()\n    ],\n    plugins: [\n      pluginExtend()\n    ]\n  }\n)\n```\n\nresult css:\n\n``` css\n.clearfix:before,\n.clearfix:after,\n.nav:before,\n.nav:after {\n    content: \" \";\n    display: table;\n}\n.clearfix:after,\n.nav:after {\n    clear: both;\n}\n.clearfix,\n.nav {\n    *zoom: 1;\n}\n.nav {\n    color: red;\n}\n```\n\n\n## Option\n\n\n### option.className [string] \\(default: 'clearfix'\\)\n\nClass name for the clearfix, should **without dot**\n\n\n### option.useBlock [boolean] \\(default: false\\)\n\nWhether use **display: block** instead of **display: table**\n\nsee: [the different](http://cssmojo.com/the-very-latest-clearfix-reloaded/)\n\n\n### option.oldIE [boolean] \\(default: false\\)\n\nWhether support oldIE (IE 6,7), by adding `*zoom: 1;` to container.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssobj%2Fcssobj-intro-clearfix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcssobj%2Fcssobj-intro-clearfix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssobj%2Fcssobj-intro-clearfix/lists"}