{"id":15388083,"url":"https://github.com/calebdwilliams/snowpack-lit-scss-plugin","last_synced_at":"2025-04-15T20:20:55.659Z","repository":{"id":40302322,"uuid":"349270277","full_name":"calebdwilliams/snowpack-lit-scss-plugin","owner":"calebdwilliams","description":"A Snowpack plugin for LitElement and SCSS","archived":false,"fork":false,"pushed_at":"2022-04-17T06:54:07.000Z","size":397,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T09:57:42.126Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/calebdwilliams.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-19T01:53:20.000Z","updated_at":"2022-03-27T16:18:40.000Z","dependencies_parsed_at":"2022-08-09T16:45:39.201Z","dependency_job_id":null,"html_url":"https://github.com/calebdwilliams/snowpack-lit-scss-plugin","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebdwilliams%2Fsnowpack-lit-scss-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebdwilliams%2Fsnowpack-lit-scss-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebdwilliams%2Fsnowpack-lit-scss-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebdwilliams%2Fsnowpack-lit-scss-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calebdwilliams","download_url":"https://codeload.github.com/calebdwilliams/snowpack-lit-scss-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248638610,"owners_count":21137690,"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-10-01T14:55:26.279Z","updated_at":"2025-04-15T20:20:55.632Z","avatar_url":"https://github.com/calebdwilliams.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# snowpack-lit-scss-plugin\n\nThis package is a simple Snowpack plugin to load SCSS as JavaScript modules for use with LitElement. Any file with the `.lit.scss` extension will be compiled and loaded using Lit's `css` tagged template literal. Any other `.scss` files will be added to the document head.\n\n## Install\n\n```shell\nnpm i snowpack-lit-scss-plugin\n```\n\n## Usage\n\nCreate a .lit.scss file:\n\n```scss\n/* my-element.lit.scss */\n\n$font-stack: Helvetica, sans-serif;\n$primary-color: #333;\n\nbody {\n  font: 100% $font-stack;\n  color: $primary-color;\n}\n```\n\nThen import it and use it in your element.\n\nJavaScript:\n\n```javascript\n/* my-element.js */\n\nimport {LitElement, html} from 'lit';\nimport styles from './my-element.lit.scss';\n\nclass MyElement extends LitElement {\n  static styles = styles;\n  /* ... */\n}\ncustomElements.define('my-element', MyElement);\n```\n\nTypeScript:\n\n```typescript\n/* my-element.ts */\n\nimport {LitElement, html} from 'lit';\nimport {customElement} from 'lit/decorators.js';\nimport styles from './my-element.lit.scss';\n\n@customElement('my-element')\nclass MyElement extends LitElement {\n  static styles = styles;\n  /* ... */\n}\n```\n\nIt's customary to give the same name to your styles file and your element (e.g. `my-element.lit.scss` for `my-element.js`) but it's not required, especially if you use the same style file for multiple elements.\n\nThe `styles` property of a LitElement can also be an array, e.g. (in JavaScript) :\n\n```javascript\nimport {LitElement, html, css} from 'lit';\nimport commonStyles from './common.lit.scss';\n\nclass MyElement extends LitElement {\n  static styles = [commonStyles, css`/* more styles */`];\n  /* ... */\n}\ncustomElements.define('my-element', MyElement);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalebdwilliams%2Fsnowpack-lit-scss-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalebdwilliams%2Fsnowpack-lit-scss-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalebdwilliams%2Fsnowpack-lit-scss-plugin/lists"}