{"id":19286796,"url":"https://github.com/adobe-webplatform/dropcap.js","last_synced_at":"2025-10-04T23:55:49.717Z","repository":{"id":21378989,"uuid":"24696513","full_name":"adobe-webplatform/dropcap.js","owner":"adobe-webplatform","description":"Beautiful CSS drop caps made easy","archived":false,"fork":false,"pushed_at":"2019-01-13T14:27:29.000Z","size":180,"stargazers_count":926,"open_issues_count":11,"forks_count":70,"subscribers_count":63,"default_branch":"master","last_synced_at":"2025-09-25T04:28:53.732Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/adobe-webplatform.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE.MD","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-01T21:41:19.000Z","updated_at":"2025-09-18T13:40:42.000Z","dependencies_parsed_at":"2022-07-27T16:33:27.900Z","dependency_job_id":null,"html_url":"https://github.com/adobe-webplatform/dropcap.js","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/adobe-webplatform/dropcap.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe-webplatform%2Fdropcap.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe-webplatform%2Fdropcap.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe-webplatform%2Fdropcap.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe-webplatform%2Fdropcap.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adobe-webplatform","download_url":"https://codeload.github.com/adobe-webplatform/dropcap.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe-webplatform%2Fdropcap.js/sbom","scorecard":{"id":167126,"data":{"date":"2025-08-11","repo":{"name":"github.com/adobe-webplatform/dropcap.js","commit":"3ea97f11002ef2a24168572942175dff55db1e31"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Code-Review","score":1,"reason":"Found 4/26 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.MD:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T15:13:17.909Z","repository_id":21378989,"created_at":"2025-08-16T15:13:17.910Z","updated_at":"2025-08-16T15:13:17.910Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278391186,"owners_count":25978945,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-09T22:04:23.284Z","updated_at":"2025-10-04T23:55:49.675Z","avatar_url":"https://github.com/adobe-webplatform.png","language":"HTML","readme":"dropcap.js\n===========\n\ndropcap.js makes beautiful drop caps easy for the web. Try it out at [http://webplatform.adobe.com/dropcap.js/](http://webplatform.adobe.com/dropcap.js/)\n\n## Why\nThough drop caps are very common in magazines and books, they remain rare on the web. We believe this is because doing it right simply and reliably is too difficult. A simple CSS float:left on a ::first-letter pseudo-element is not enough, as this [tumblr][tumblr] shows. This [blog post][blog] explains some of the challenges of defining drop caps in CSS today.\n\nThe CSS Working Group is currently specifying a [new property for drop cap layout][initial-letter]. Until this makes it into all our favorite browsers we wanted to make it work with today's platform.\n\n## Getting Started\n\nOptions for adding dropcap.js to your project:\n\n* Install with [npm](https://npmjs.org): `npm install dropcap.js`\n* Clone the repo: `git clone https://github.com/adobe-webplatform/dropcap.js.git` \n\n## Using dropcap.js\n\n**First**, your drop cap letters need to be enclosed in an HTML element e.g.:\n\n    \u003cp\u003e\n        \u003cspan class=\"dropcap\"\u003eT\u003c/span\u003eHE Quick Brown Fox...\n    \u003c/p\u003e\n\nThis is required because the CSS Object Model does not expose write access to the styling of pseudo-elements like ::first-letter; until then, explicit markup is preferred in this version.\n\n**Then**, once you have updated your markup, simply include the script in your page.\n   \n    \u003cscript src='./dropcap.min.js'\u003e\u003c/script\u003e\n\nThe script defines the `window.Dropcap.layout` method; you call it like so:\n\n    window.Dropcap.layout(dropcapRef, heightInLines, baselinePos);\n\nFor instance:\n\n    \u003cscript src='./dropcap.min.js'\u003e\u003c/script\u003e\n    \u003cscript\u003e\n        // We retrieve our drop cap elements using a class selector...\n        var dropcaps = document.querySelectorAll(\".dropcap\"); \n        // ...then give them a height of three lines. \n        // By default, the drop cap's baseline will also be the third paragraph line.\n        window.Dropcap.layout(dropcaps, 3); \n    \u003c/script\u003e\n\nFor a live example, see the [source code][site-page] of the our [project home page][project-home].\n    \n### Dropcap.layout(dropcapRef, heightInLines, baselinePos)\n\n**dropcapRef**\n\nThe `dropcapRef` parameter may be one of:\n\n* An individual HTMLElement object \n* A NodeList e.g. obtained from `querySelectorAll()` or a property such as `Node.childNodes` \n\nFor instance:\n\n\t\t\u003cscript src='./dropcap.min.js'\u003e\u003c/script\u003e\n\t\t\u003cscript\u003e\n\t\t\tvar dropcaps = document.querySelectorAll(\".dropcap\");\n    \t\twindow.Dropcap.layout(dropcaps, 3);\n    \t\u003c/script\u003e\n\t\t\n \nThe specified element(s) will be floated, sized and positioned based on the values you specify for `baselinePos` and `heightInLines`.\n\n**heightInLines**\n\nThe `heightInLines` parameter must have a value of 1 or higher. It specifies the height of the drop cap as a number of lines of the adjoining paragraph. \n\n**baselinePos (optional)**\n\nThe `baselinePos` parameter is optional; when specified, its value should be 1 or higher. It defines which baseline of its parent element the drop cap's own baseline must align with. For instance, a value of 4 means 'align the drop cap's baseline with the baseline of the paragraph's fourth line'. By default, `baselinePos` is the same as `heightInLines`, which makes the drop cap extend from the baseline of the `baselinePos`-th line to the cap line of the first line. (This is the most common use-case). When `baselinePos` is smaller than `heightInLines`, the result is that of a 'raised cap' as the top of the drop cap will be a number of lines above the first line of the paragraph.\n\n### The Dropcap.options object\n\nThe properties of the options object expose general runtime configuration features of dropcap.js.\n\n**runEvenIfInitialLetterExists**\n\nDefault value: `true`\n\nWhen this option is true, `Dropcap.layout` will run whether or not the browser supports the `initial-letter` property. When set to false, `Dropcap.layout` will first check for the presence of `initial-letter` in the CSSOM and abort if it is found. Prefixed variations are checked.\n\n\n## Building dropcap.js\n\nTo edit and build your own version of dropcap.js, you will need [node][node], [npm][npm], and [grunt][grunt]. To build:\n\n1. Clone the repository\n2. Enter the src directory of the repo\n3. Run `npm install`\n4. Run `grunt build`\n\nYou should see a `dropcap.js` and `dropcap.min.js` in the repository's root.\n\n## Testing dropcap.js\n\nThe test folder currently has one test. The ten-line-tests.html file has\nseveral large initial letters hand-coded to look correct in Mac Firefox.\nThe test button will run `window.Dropcap.layout` on all of these initial\nletters and measure the difference between the script output and the\nhand-coded expected result. The differences are displayed in the console.\nThis test was used to confirm whether iterations on the library were\nimproving or degrading the result.\n\n## Known Constraints \u0026 Limitations\n\n* We recommend setting an explicit line-height value for your drop caps' parent element. At least one browser (Chrome) computes the property's initial value of 'normal' to 'normal' instead of a length. You will get the best results with a length value or a factor like 1.2.\n* dropcap.js currently assumes western content. Other international conventions - e.g. drop words, or Asian script conventions - are not supported.\n* The current logic assumes the drop cap element's content to be a single glyph. It will not fail with several but was tested for single-glyph use.\n* Dynamic content updates or document resizing are not automatically handled. It is up to the application to call `window.Dropcap.layout` when necessary.\n* Fonts are assumed to be loaded by the time dropcap.js computed the font-family property.\n* The sizing and positioning of the drop cap are done using pixel lengths. A future update may use EMs.\n\n## Browser Support\n\nWe tested dropcap.js on Windows (IE10+, Firefox, Chrome) and OSX (Firefox, Chrome, Safari).\n\n## Feedback\n\nPlease let us know if you have any feedback. If you run into any problems, you can file a [new issue][new-issue]. You can also reach us [@adobeweb][twitter].\n\n\n[tumblr]: http://dauwhe.tumblr.com/\n[initial-letter]: http://dev.w3.org/csswg/css-inline/#DropInitial\n[node]: http://nodejs.org\n[npm]: http://www.npmjs.org\n[grunt]: http://gruntjs.com\n[blog]: http://blogs.adobe.com/webplatform/2014/10/02/drop-caps-are-beautiful/\n[site-page]: https://github.com/adobe-webplatform/dropcap.js/blob/gh-pages/index.html\n[project-home]: http://webplatform.adobe.com/dropcap.js/\n[new-issue]: https://github.com/adobe-webplatform/dropcap.js/issues/new\n[twitter]: http://twitter.com/adobeweb\n\n\n","funding_links":[],"categories":["📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadobe-webplatform%2Fdropcap.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadobe-webplatform%2Fdropcap.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadobe-webplatform%2Fdropcap.js/lists"}