Is it possible for Susy to output a pixel-based span?

As a newbie to Susy, I hope you don't mind if I ask a seemingly silly question...

I'm trying to figure out how to calculate responsive padding within a Susy grid.

The standard formula is: (target / context) x 100.

Is there a way for Susy to provide the 'context' in pixels, such as "span(2)", so that I can easily perform this calculation in my SASS file? Or am I totally missing something here?

Answer №1

Susy automatically calculates span widths in percentages. However, if you set "math: static' in your configuration settings, all output will adhere to those specifications.

For instance:

$susy: {
   container: auto,
   columns: 12,
   column-width: 60px;
   gutters: 1/4,
   math: static,
}

You can then use the span() function to determine column or group width.

In your SCSS code:

.myclass {
   width: span(2);
}

This would translate to width: 135px; based on the provided example.

View a sample here.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How can you modify the color of a <canvas> element using CSS?

Can the HTML5 element's color be modified using CSS as opposed to JS? I am looking to personalize qTips tooltip pointers with specific LESS CSS instructions that cannot be referenced through jQuery. ...

retrieve data beyond a certain identification number

Below is the modified SQL query that requires some adjustments: SELECT DISTINCT ic.img_path, ic.id FROM images_community ic WHERE ic.delete_flag = 0 AND ic.status = 1 ORDER BY ( SELECT (count(id ...

What measures can be taken to stop LESS partials from compiling independently?

When working with LESS, I utilize partials that are included (@include) into the main LESS stylesheet. A common issue I face is that each partial ends up compiling to its own CSS file, leading to project clutter. In SASS, if a file is named with an unders ...

Alter the arrow to dynamically point towards the location of the click source

I am currently working on creating a popover dialog that should point to the element triggering its appearance. The goal is for the arrow to align with the middle of the button when clicked. While I am familiar with using CSS to create pointing arrows, th ...

Resolving Issues in HTML and the Dynamic Duo of PHP and MySQL

Hey there, I've been a reader for a while now but this is my first time posting. I'm really into PHP and I've been working on a page lately. Right now, I've got the DB connection set up nicely and my SELECT statement is doing exactly wh ...

Hover over with your mouse to open and close the dropdown menu in React JS

Just starting out with React JS and encountering a small issue. I'm trying to make the menu disappear when the mouse leaves that area, so I used onMouseOut and onMouseLeave to close it. However, I noticed that having these options in place prevents th ...

Seamless scrolling experience achieved after implementing a header that appears when scrolling up

My goal is to create a header with the following functionalities: Initially displays with a transparent background Upon scrolling down the page by 25px, it will dynamically add the header--maroon class to the header, which alters the background color and ...

Is there a way to display the true colors of a picture thumbnail when we click on it?

In my project, I attempted to create a dynamic color change effect when clicking on one of four different pictures. The images are displayed as thumbnails, and upon clicking on a thumbnail, it becomes active with the corresponding logo color, similar to t ...

Unusual Behavior of CSS and JQuery Selectors

As I was working with jquery selectors, I encountered something quite unexpected. This is an example of my HTML: <ul id="unordered-list"> <li> <img src="https://www.google.com/images/srpr/logo4w.png" width="40" height="40"/> ...

Is there a way to use htaccess to make a subfolder behave as the main document root?

Here is the site location: http://localhost/~username/website This website has numerous images loaded with an absolute url like /image/image.png. What I'm looking to achieve is that when a request comes in for: http://localhost/~username/website/ima ...

Homepage featuring a stacked image background similar to Kickstarter

I am trying to replicate the stacked image effect seen on kickstarter.com. However, I am facing an issue where the images do not overflow on the screen as desired. The arrow indicates the area that needs to be filled with the image. Check out the image he ...

Use PHP to convert a string into an array and assign keys from a separate array

Is there a method to break down a string into an associative array using keys from another array? For instance, if I have the following array: $array = array('firstname' => 'john', 'lastname' => 'smith'); and ...

The attempt to execute 'removeChild' on 'Node' was unsuccessful because parameter 1 is not the correct type. Although it did remove the elements from the DOM, it only did so once

It's quite a challenge I'm facing!!! Although there have been similar questions asked before, they were all for specific scenarios. I am currently developing a tictactoe game using the module design pattern. The function below helps me create tw ...

Is there a method in bootstrap that reveals the elements with the hidden class?

Currently, I am loading data into a bootstrap table on my JSP. The table class is hidden at the moment. After successfully uploading the data into the bootstrap table, I have implemented the following code: $(function() { var table = $('#Table') ...

A group of Symfony Messenger consumers working together efficiently

Is it feasible to have a shared pool of messenger consumers for the same queue? I attempted to utilize the Redis consumer= options, but to no avail. Perhaps a "pool" middleware could facilitate routing to particular transports? ...

"I am facing an issue where the button does not appear centered after using jQuery

I can't help but notice that when applying CSS directly, my buttons end up centered horizontally. Yet, when I insert the same code using append(), the buttons seem to align towards one side instead. Here is the HTML/CSS code snippet: <div style=" ...

What is the best way to integrate my custom JavaScript code into my WordPress theme, specifically Understrap?

I am looking to enhance my website with a sticky navbar positioned directly under the header, and I want it to stick to the top of the page as users scroll down. Additionally, I want the header to disappear smoothly as the user scrolls towards the navbar. ...

Experience the magic of a customized cursor that disappears with a simple mouse movement in your website,

I have been experimenting with designing a custom cursor for my website. After finding a design I liked, I made some adjustments to suit my needs. However, an issue I encountered is that when I scroll, the custom cursor also moves away from its original po ...

Looking for a way to add a CSS effect that reveals another image or text when hovering over an image?

My company's website features 10 country flags that, when clicked, display the entire site in that country's language for the user's session. However, I want to take it a step further and have a small image of the respective country appear w ...

When the CSS grid is equipped with a sticky left column, it will horizontally scroll if the grid's width exceeds 100% of its containing element

I am facing an issue with a CSS grid layout that has sticky left and right columns as shown below: .grid { display: grid; grid-template-columns: repeat(10, 200px); } .grid > div { border: 1px solid black; background-color: white; } .sticky- ...