{"id":13563167,"url":"https://github.com/csstools/oldie","last_synced_at":"2025-04-28T17:31:14.682Z","repository":{"id":57314134,"uuid":"43662636","full_name":"csstools/oldie","owner":"csstools","description":"Compile CSS compatible with old Internet Explorer","archived":true,"fork":false,"pushed_at":"2016-08-12T15:34:29.000Z","size":344,"stargazers_count":169,"open_issues_count":3,"forks_count":9,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-21T21:39:21.441Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://jonathantneal.github.io/oldie","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csstools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-05T02:56:26.000Z","updated_at":"2024-12-27T18:05:49.000Z","dependencies_parsed_at":"2022-09-20T23:30:53.845Z","dependency_job_id":null,"html_url":"https://github.com/csstools/oldie","commit_stats":null,"previous_names":["jonathantneal/oldie"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Foldie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Foldie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Foldie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Foldie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/oldie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251218909,"owners_count":21554441,"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-08-01T13:01:15.837Z","updated_at":"2025-04-28T17:31:14.666Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Oldie [![Build Status][ci-img]][ci]\n\n\u003cimg align=\"right\" width=\"135\" height=\"95\" src=\"http://postcss.github.io/postcss/logo-leftp.png\" title=\"Philosopher’s stone, logo of PostCSS\"\u003e\n\n[Oldie] tranforms CSS to be compatible with old Internet Explorer.\n\n```html\n\u003c!--[if gt IE 8]\u003e\u003c!--\u003e\u003clink href=\"style.css\" rel=\"stylesheet\"\u003e\u003c!--\u003c![endif]--\u003e\n\u003c!--[if lte IE 8]\u003e\u003clink href=\"style.oldie.css\" rel=\"stylesheet\"\u003e\u003c![endif]--\u003e\n```\n\nIf you’re like me, you stopped supporting IE8 years ago. Yet, here you are, satisfying another client that somehow managed to get this requirement past you.\n\n### Flatten Media Queries\n\nResolve media queries for a desktop experience.\n\n```css\n/* before */\n\nbody {\n    font-size: 12px;\n}\n\n@media screen and (max-width: 767px) {\n    body {\n        font-size: 16px;\n    }\n}\n\n@media screen and (min-width: 768px) {\n    body {\n        color: #444;\n    }\n}\n\n/* after */\n\nbody {\n    font-size: 12px;\n}\n\nbody {\n    color: #444;\n}\n```\n\n### Replace :root\n\nSwap `:root` selectors with `html` selectors.\n\n```css\n/* before */\n\n:root {\n    background-color: black;\n    color: white;\n}\n\n/* after */\n\nhtml {\n    background-color: black;\n    color: white;\n}\n```\n\n### Reduce calc()\n\nReduce `calc()` references whenever possible.\n\n```css\n/* before */\n\n.banner {\n    font-size: calc(16px * 3);\n}\n\n/* after */\n\n.banner {\n    font-size: 48px;\n}\n```\n\n### Resolve rem\n\nResolve `rem` values as standard pixels.\n\n```css\n/* before */\n\n.container {\n    margin-top: 2.5rem;\n}\n\n/* after */\n\n.container {\n   margin-top: 40px;\n}\n```\n\n### Uphold opacity\n\nSwap `opacity` properties with IE8 compatible `filter` properties.\n\n```css\n/* before */\n\n.figure {\n    opacity: .5;\n}\n\n/* after */\n\n.figure {\n    filter: alpha(opacity=50);\n}\n```\n\n### Patch pseudo-elements\n\nSwap `::` selectors with IE8 compatible `:` selectors.\n\n```css\n/* before */\n\na::after {\n    content: \" (\" attr(href) \")\";\n}\n\n/* after */\n\na:after {\n    content: \" (\" attr(href) \")\";\n}\n```\n\n### Retain rgba colors\n\nSwap `rgba` values with IE8 compatible hex values and filter properties.\n\n```css\n/* before */\n\n.hero {\n    background-color: rgba(153, 221, 153, .8);\n    border: solid 1px rgba(100, 102, 103, .3);\n}\n\n/* after */\n\n.hero {\n    filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#8099dd99',endColorstr='#8099dd99');\n    border: solid 1px #646667;\n}\n```\n\n### Forget :not\n\nRemove `:not()` selectors while preserving the other selectors in a rule.\n\n```css\n/* before */\n\n.a, .b:not(.c), d {\n    color: red;\n}\n\n/* after */\n\n.a, .d {\n    color: red;\n}\n```\n\n### Salvage :nth-child\n\nSwap `:nth-child` selectors with `:first-child`.\n\n```css\n/* before */\n\n.container \u003e p:nth-child(4).specific \u003e span {\n   font-weight: bold;\n}\n \n/* after */\n \n.container \u003e :first-child + * + * + p.specific \u003e span {\n    font-weight: bold;\n}\n```\n\n## Plugins\n\n[Oldie] is powered by the following plugins:\n\n- [PostCSS Calc](https://github.com/postcss/postcss-calc)\n- [PostCSS UnMQ](https://github.com/jonathantneal/postcss-unmq)\n- [PostCSS UnRoot](https://github.com/jonathantneal/postcss-unroot)\n- [PostCSS UnNth](https://github.com/jonathantneal/postcss-unnth)\n- [PostCSS UnNot](https://github.com/jonathantneal/postcss-unnot)\n- [PostCSS UnOpacity](https://github.com/jonathantneal/postcss-unopacity)\n- [PostCSS UnRGBA](https://github.com/jonathantneal/postcss-unrgba)\n- [PostCSS Pixrem](https://github.com/robwierzbowski/node-pixrem)\n- [PostCSS Pseudo Elements](https://github.com/axa-ch/postcss-pseudoelements)\n\nSome of these plugins have more features than are described here. Visit their project pages to learn more about them individually.\n\n## Usage\n\nFollow these steps to use [Oldie].\n\nAdd [Oldie] to your build tool:\n\n```bash\nnpm install oldie --save-dev\n```\n\n#### Node\n\n```js\nrequire('oldie')({ /* options */ }).process(YOUR_CSS);\n```\n\n#### PostCSS\n\nAdd [PostCSS] to your build tool:\n\n```bash\nnpm install postcss --save-dev\n```\n\nLoad [Oldie] as a PostCSS plugin:\n\n```js\npostcss([\n    require('oldie')({ /* options */ })\n]);\n```\n\n#### Gulp\n\nAdd [Gulp PostCSS] to your build tool:\n\n```bash\nnpm install gulp-postcss --save-dev\n```\n\nEnable [Oldie] within your Gulpfile:\n\n```js\nvar postcss = require('gulp-postcss');\n\ngulp.task('css', function () {\n    return gulp.src('./css/src/*.css').pipe(\n        postcss([\n            require('oldie')({ /* options */ })\n        ])\n    ).pipe(\n        gulp.dest('./css')\n    );\n});\n```\n\n#### Grunt\n\nAdd [Grunt PostCSS] to your build tool:\n\n```bash\nnpm install grunt-postcss --save-dev\n```\n\nEnable [Oldie] within your Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-postcss');\n\ngrunt.initConfig({\n    postcss: {\n        options: {\n            processors: [\n                require('oldie')({ /* options */ })\n            ]\n        },\n        dist: {\n            src: 'css/*.css'\n        }\n    }\n});\n```\n\n## Options\n\nEach plugin’s options may be configured by targeting the plugin’s namespace. Any plugins may be disabled by giving them a `disable` property.\n\nExample:\n```js\nrequire('oldie')({\n    rgba: {\n        filter: true\n    },\n    rem: {\n        replace: false\n    },\n    unmq: {\n        disable: true\n    }\n})\n```\n\n[ci]: https://travis-ci.org/jonathantneal/oldie\n[ci-img]: https://travis-ci.org/jonathantneal/oldie.svg\n[Gulp PostCSS]: https://github.com/postcss/gulp-postcss\n[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss\n[PostCSS]: https://github.com/postcss/postcss\n[Oldie]: https://github.com/jonathantneal/oldie\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Foldie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Foldie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Foldie/lists"}