Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@saithodev/amp-css
Advanced tools
Provides a binary to compile SCSS files and validate them for AMP.
AMP (Accelerated Mobile Pages) is a project by Google and the Digital News Initiative aiming to improve the speed of websites by utilizing a special JavaScript framework.
This comes with restrictions to the size and contents of CSS. This package provides a binary to compile SCSS files only if the resulting CSS is valid for AMP. Also it provides a way to insert CSS into a (static) HTML page.
npm install --save-dev @saithodev/amp-css
pnpm install --save-dev @saithodev/amp-css
yarn add --dev @saithodev/amp-css
The following example will compile the file path/to/my/scss/style.scss
into the CSS file path/to/my/css/style.css
if there is no invalid CSS inside and the file size does not exceed AMP's size limit.
amp-css process path/to/my/scss/style.scss path/to/my/css/style.css
Alternatively you can also set an output directory. The following line does exactly the same as the line above:
amp-css process --output-dir path/to/my/css path/to/my/scss/style.scss
AMP requires websites to embed the stylings using inline CSS. There is a command that will look for the "Custom AMP CSS" area in a HTML file and overwrite its contents with the content of a given CSS file.
amp-css assign -s mycss.css index.html
We recommend defining scripts inside your projects package.json:
"scripts": {
"build": "npm run-script build-css && npm run-script assign-css",
"build-css": "amp-css process -s assets/scss/styles.scss assets/css/styles.css",
"assign-css": "amp-css assign -s assets/css/styles.css index.html"
}
In the example above calling npm run-script build
(or yarn build
) will compile the CSS file and insert it into the index.html file.
There currently is no support for compiling multiple SCSS files or inserting multiple CSS files. I currently don't see a use case for that.
If your stylings consists of multiple stylings, @import
them all in one SCSS file which you then compile.
FAQs
Provides a binary to compile SCSS files and validate them for AMP.
We found that @saithodev/amp-css demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.