Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
RFS stands for Responsive Font-Size and is an easy to use SCSS-mixin which automatically calculates the appropriate font-size based on the dimensions of the monitor or device.
You can use RFS in your project by installing it using a package manager (recommended):
npm:
$ npm install rfs --save
yarn:
$ yarn add rfs
Bower:
$ bower install rfs --save
Copy/paste (not recommended):
You can download the RFS SCSS-file and save it in your scss/
directory. This method is not recommended because you
lose the ability to easily and quickly manage and update RFS as a dependency.
This input (SCSS):
.title {
@include font-size(62);
}
Will generate this (CSS):
.title {
font-size: 62px;
}
@media (max-width: 1200px) {
.title {
font-size: calc(23.6px + 3.2vw);
}
}
In this case a value without unit was passed to the mixin (62
), which is interpreted as 62px
. It's also possible to
pass font-sizes in rem-units. Since v5.0.0 font-size()
is added as an alias for rfs()
.
There are configuration variables which influence the calculation of the font size. In the graph above the default configuration is used.
$rfs-minimum-font-size: (in px
or rem
)
Font sizes which are calculated by RFS will never be lower than this size. However, you can still pass a smaller font
size to RFS, but then RFS won't dynamically scale this font size. For example (see graph above): font-size(19)
will
trigger dynamic rescaling, with font-size(10)
it will just stay 10px
all the time.
Default value: 14px
$rfs-minimum-font-size-unit: (string)
The font size will be rendered in this unit. Possible units are px
and rem
.
Default value: px
$rfs-breakpoint: (in px
, em
or rem
)
Above this breakpoint, the font size will be equal to the font size you passed to the mixin; below the breakpoint, the
font size will dynamically scale.
Default value: 1200px
$rfs-breakpoint-unit: (string)
The width of $rfs-breakpoint
will be rendered in this unit. Possible units are px
, em
and rem
.
Default value: px
$rfs-factor: (number)
This value determines the strength of font size resizing. The higher $rfs-factor
, the less difference there is between
font sizes on small screens. The lower $rfs-factor
, the less influence RFS has, which results in bigger font sizes for
small screens. $rfs-factor
must me greater than 1, setting it to 1 will disable dynamic rescaling.
Default value: 5
$rfs-two-dimensional (Boolean)
Enabling the two dimensional media queries will determine the font size based on the smallest side of the screen with
vmin
. This prevents the font size from changing if the device toggles between portrait and landscape mode.
Default value: false
html
or body
, otherwise some text may not dynamically rescale. Note
that setting RFS on html
will influence the value of rem
.em
or unitless).FAQs
Powerful & easy-to-use responsive resizing engine.
The npm package rfs receives a total of 11,322 weekly downloads. As such, rfs popularity was classified as popular.
We found that rfs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.