Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@shopmacher/trinity
Advanced tools
Media query mixins for multiple devices and grid systems using LESS
Trinity is a less library for handling reponsive breakpoints of devices and frameworks painlessly.
Trinity can be installed via npm. Simply type:
npm i -S @shopmacher/trinity
After installing trinity, you can integrate it in your project depending on what build engine you use.
If you use webpack as your build engine, make sure you have a less-loader set up. Then you can include trinity either in your less file using
@import '~@shopmacher/trinity/lib/trinity.less';
For any other build engine besides webpack, make sure to include the following file in your less bundle:
node_modules/@shopmacher/trinity/lib/trinity.less
Trinity provides a set of breakpoints and mixins for different screen sizes and UI frameworks. This section shows, how to use the trinity mixins for the different devices.
All mixins are used in a similar way, which is:
.device({
// Styles for the device here
});
Simply replace device
with a device from one of the
devices-sections below,
as in this example for a mobile device in landscape orientation:
.mobile-landscape({
// Mobile landscape styles here
});
If you do not want to use the mixins, you always have the option to
use the @media
keyword in conjunction with the breakpoints.
@media @mobile {
// Mobile styles here
}
In some cases, you want to provide style for a specific screen size and
all above that one. For example: mobile and above. For this, trinity
allows you to add the -up
suffix, to every mixin available including
orientations.
.mobile-up({
// This styles mobile and larger devices (tablet, desktop)
)}
If the built-in breakpoints are not sufficient for you, there is a mixin to use custom breakpoints.
@min: 300px;
@max: 500px;
.responsive(@min, @max, {
// This styles devices from @min to @max width
});
.reponsive(@min, {
// This styles devices from @min width and up
});
The following tables show the different built-in devices and breakpoints.
Device | min-width | max-width |
---|---|---|
mobile | mobile-min | mobile-max |
mobile-portrait | " | " |
mobile-landscape | " | " |
Breakpoint | Value |
---|---|
mobile-min | 320px |
mobile-max | 480px |
Device | min-width | max-width |
---|---|---|
tablet | tablet-min | tablet-max |
tablet-portrait | " | " |
tablet-landscape | " | " |
Breakpoint | Value |
---|---|
tablet-min | 768px |
tablet-max | 1024px |
Device | min-width | max-width |
---|---|---|
desktop | desktop-min | - |
Breakpoint | Value |
---|---|
desktop-min | 1025px |
If you use the bootstrap framework, you can use the following breakpoints as they reflect the ones bootstrap uses.
Mixin | min-width | max-width |
---|---|---|
xs | 0 | xs-max |
sm | sm-min | sm-max |
md | md-min | md-max |
lg | lg-min | - |
Breakpoint | Value |
---|---|
xs-max | 768px |
sm-min | 769px |
sm-max | 991px |
md-min | 992px |
md-max | 1199px |
lg-min | 1200px |
In order to make contributions to the project, fork the project and create a feature/hotfix branch with the contribution you want to make.
When you finished developing, document the changes and submit a pull request.
Of course, you can always submit issues for bugs or feature-requests.
MIT
FAQs
Media query mixins for multiple devices and grid systems using LESS
We found that @shopmacher/trinity demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.