{"id":13399269,"url":"https://github.com/LeaVerou/prefixfree","last_synced_at":"2025-03-14T04:31:12.558Z","repository":{"id":57329743,"uuid":"2556901","full_name":"LeaVerou/prefixfree","owner":"LeaVerou","description":"Break free from CSS prefix hell!","archived":true,"fork":false,"pushed_at":"2021-10-13T20:37:47.000Z","size":404,"stargazers_count":3821,"open_issues_count":97,"forks_count":713,"subscribers_count":151,"default_branch":"gh-pages","last_synced_at":"2024-10-30T00:36:03.332Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://projects.verou.me/prefixfree/","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/LeaVerou.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":"2011-10-11T17:30:57.000Z","updated_at":"2024-10-25T09:36:56.000Z","dependencies_parsed_at":"2022-09-10T13:51:26.595Z","dependency_job_id":null,"html_url":"https://github.com/LeaVerou/prefixfree","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/LeaVerou%2Fprefixfree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeaVerou%2Fprefixfree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeaVerou%2Fprefixfree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeaVerou%2Fprefixfree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeaVerou","download_url":"https://codeload.github.com/LeaVerou/prefixfree/tar.gz/refs/heads/gh-pages","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243526533,"owners_count":20305108,"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-30T19:00:35.850Z","updated_at":"2025-03-14T04:31:07.547Z","avatar_url":"https://github.com/LeaVerou.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Web 前端","5. 基础模版","CSS Polyfills"],"sub_categories":["Editor's Draft :black_nib:"],"readme":"# [-prefix-**free**](https://leaverou.github.io/prefixfree/)\n## Break free from CSS prefix hell!\n\n[Project homepage](https://leaverou.github.io/prefixfree/)\n\nA script that lets you use only unprefixed CSS properties everywhere. \nIt works behind the scenes, adding the current browser’s prefix to any CSS code, only when it’s needed.\n\n## API Documentation\nNote: To use -prefix-free you don't need to write any JS code, just to include prefixfree.js in your page. The following is meant mostly for plugin authors.\n\n-prefix-free creates 2 global variables: `StyleFix` and `PrefixFree`. StyleFix is a framework for building various CSS fixers and -prefix-free depends on it. Currently, StyleFix is bundled with -prefix-free and only available this way, but it might eventually get split to a separate project, with separate documentation.\n\n## StyleFix API Documentation\n\n### Properties\n\tStyleFix.fixers\nAn array of the current callbacks.\n\n### Functions\n\tStyleFix.register(callback)\nAdds `callback` to the queue of functions that will be called when fixing CSS code. `callback` will be called with the following parameters:\n\n* **css** (String): The CSS code that is being processed,\n* **raw** (Boolean): Whether the CSS code can contain rules etc or it's just a bunch of declarations (such as the ones found in the `style` attribute),\n* **element** (HTMLElement): The node that the CSS code came from (such as a `\u003clink\u003e` element, a `\u003cstyle\u003e` element or any element with a `style` attribute)\n\nand it should return the fixed CSS code.\n\n\tStyleFix.link(linkElement)\n\nProcesses a `\u003clink rel=\"stylesheet\"\u003e` element and converts it to a `\u003cstyle\u003e` element with fixed code. Relative URLs will be converted.\n\n\tStyleFix.styleElement(styleElement)\n\t\nFixes code inside a `\u003cstyle\u003e` element.\n\n\tStyleFix.styleAttribute(element)\n\t\nFixes code inside the `style` attribute of an element. Will not work in IE and Firefox \u0026lt; 3.6 due to a bug those have with `getAttribute('style')`: In IE invalid values of valid properties will be dropped, and in Firefox \u0026lt; 3.6 anything invalid will be dropped.\n\n\tStyleFix.camelCase(str)\n\tStyleFix.deCamelCase(str)\nUtility methods that convert a string to camelCase and back.\n\n## -prefix-free API Documentation\n\n### Properties\n\tPrefixFree.prefix\nThe detected prefix of the current browser (like `'-moz-'` or `'-webkit-'`)\n\n\tPrefixFree.Prefix\nThe detected prefix of the current browser in camelCase format (like `'Moz'` or `'Webkit'`)\n\n\tPrefixFree.properties\n\tPrefixFree.functions\n\tPrefixFree.keywords\n\tPrefixFree.selectors\n\tPrefixFree.atrules\nProperties/functions/keywords/etc that are **only** available with a prefix in the current browser.\n\n### Functions\n\tPrefixFree.prefixCSS(code [, raw])\nPrefixes the properties and values in the code passed with the prefix of the current browser, only when needed. If the second parameter is truthy, it also prefixes selectors and @-rules. This is the most useful method in -prefix-free.\n\n\tPrefixFree.prefixSelector(selector)\n\tPrefixFree.prefixProperty(property)\nPrefixes the passed selector or property. The property is prefixed **even when it's supported prefix-less**. These are more internal methods and I assume they won't be too useful in general.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeaVerou%2Fprefixfree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLeaVerou%2Fprefixfree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeaVerou%2Fprefixfree/lists"}