{"id":20220240,"url":"https://github.com/maximeij/luminosity-css","last_synced_at":"2026-06-20T04:31:11.646Z","repository":{"id":224264305,"uuid":"656341242","full_name":"MaximeIJ/luminosity-css","owner":"MaximeIJ","description":"💡 Duo of customizable CSS classes to define a light source location and cast dynamic shadows off elements based on their relative position. Themable and customizable with CSS variables","archived":false,"fork":false,"pushed_at":"2024-02-24T21:46:36.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-30T14:39:40.955Z","etag":null,"topics":["css","light","shadow","web"],"latest_commit_sha":null,"homepage":"https://maximeij.dev/luminosity-css/","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaximeIJ.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-06-20T18:47:38.000Z","updated_at":"2024-02-01T14:12:00.000Z","dependencies_parsed_at":"2024-02-24T22:47:39.300Z","dependency_job_id":null,"html_url":"https://github.com/MaximeIJ/luminosity-css","commit_stats":null,"previous_names":["maximeij/luminosity-css"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MaximeIJ/luminosity-css","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeIJ%2Fluminosity-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeIJ%2Fluminosity-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeIJ%2Fluminosity-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeIJ%2Fluminosity-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaximeIJ","download_url":"https://codeload.github.com/MaximeIJ/luminosity-css/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeIJ%2Fluminosity-css/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34557551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"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":["css","light","shadow","web"],"created_at":"2024-11-14T06:45:44.436Z","updated_at":"2026-06-20T04:31:11.629Z","avatar_url":"https://github.com/MaximeIJ.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💡 luminosity.css\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/MaximeIJ/luminosity-css/assets/5600516/a9aa4364-f4b5-4d75-a44e-3d8b58d83d97\" height=330 align=\"center\" alt=\"High contrast mini demo of luminosity.css\" /\u003e\n\u003c/p\u003e\n\nThis repository provides two themable and customizable CSS classes that can add dynamic lighting to your web page. Try out the [demo](https://maximeij.dev/luminosity-css)!\n\n1. `light-effect` is applied to any element you want casting a shadow. It will use css variables you define to calculate the proper directly and size for the shadow given your element's position relative to the light source.\n2. `light-source` is applied to the container and will add a gradient based layer to lighten content close to the source and dark content that is further. Note it's not needed for `light-effect` to work and serves to double down on the luminosity effect.\n\n## Usage\n\n### Basic\n\n- Copy [luminosity.css](luminosity.css) into your project.\n  - Modify it if you need to, otherwise apply its classes `.light-effect` and `.light-source` as needed.\n- Supply required CSS variables if you don't want default.\n  - This is particularly important for element position `--lc-x` and `--lc-y`.\n  - See [luminosity.css](luminosity.css) for a description of each variable.\n- Take a look at the [demo](index.html) for a working example to get started.\n\n### Theming\n\nYou can control the colors of both the ambient light source and the element shadows to fine tune to your site's pallet:\n\n- `--lc-light-on` and `--lc-light-off` can be used to customize the color of the filter applied at both ends of the `.light-effect` container gradient.\n  - Use color `opacity` to control the intensity of the ambient light filter.\n  - Combine custom colors with `--lc-light-z` and `--lc-light-m` to tighten or loosen the beam of light.\n  - Remember: `.light-effect` is not needed for directional shadows to work.\n- `--lc-shadow-color` can be used to define the color of the shadows cast by the elements with `.light-effect`. You can pass a custom value to adapt to a given pallet your site is working with and control the `opacity`.\n\n### Customizing\n\nYou can control the position of the ambient light source as well as attributes to customize the tightness of the beam and the elongation factor of shadows:\n\n- The ambient source light's position can be modified in 4 ways:\n  - `--lc-light-x` and `--lc-light-y` can be used to set the 2d coordinates of the center of the light in `%`. These values can be negative or otherwise outside the bounds of the container to give the light a faraway effect.\n  - `--lc-light-z` simulates the height of the light source and indirectly the spread of the beam and blurriness of element shadows. It's best kept positive.\n  - `--lc-light-m` is a measure of the extent of the light source's filters (both light and dark). It affects the range of the effect in the `.light-source` gradient but not the shadows of the elements.\n- `--lc-x` and `--lc-y` **must** be used on elements for directional shadows to work and should be expressed in % and correspond to the center of the element. They can be set at runtime by javascript for elements that are naturally positioned.\n- `--lc-shadow-sensitivity` determines the number of `px` the shadow is offset by for each `%` distance the element is from the light source. By default it's set at `0.05px`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximeij%2Fluminosity-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximeij%2Fluminosity-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximeij%2Fluminosity-css/lists"}