Warning: file_get_contents(Elements/Examples/20170404-Html.html): failed to open stream: No such file or directory in /home/liquid8/public_html/00_DevSites/drempd/site/pages/blog/post.php on line 78
Warning: file_get_contents(Elements/Examples/20170404-Css.html): failed to open stream: No such file or directory in /home/liquid8/public_html/00_DevSites/drempd/site/pages/blog/post.php on line 78
Warning: file_get_contents(Saphire/mixins/_block-pricing.scss): failed to open stream: No such file or directory in /home/liquid8/public_html/00_DevSites/drempd/site/pages/blog/post.php on line 78
Mostly automatically formats a price in the design shown, with the dollar sign raised and the cents is stacked above the "/mo". There are parameters to adjust the some of the placement of elements.
Why Was This Created?
This format for pricing appears quite often, so I might as well make a reusable element to get me most of the way there. It will take the font height for the dollar amount and adjust everything accordingly (although there is some placement of elements that probably needs slightly adjusted, which you can through the mixin parameters).
1. Make sure you're using SASS
2. Add the mixin code below to your SASS stylesheet
3. Add the HTML to set up your pricing:
4. For the elment you would like to style, add the CSS code below:
5. Make adjustments to the parameters in the mixin until everything is lined up and sized properly.
- The first parameter is the height for the font of the dollar amount (generally the largest font size in this arrangement).
- The second parameter is the top margin on the dollar sign, so it can be adjusted up and down as needed.
- The third parameter is the top margin for the dollar amount.
- The fourth parameter is the top margin for the cents.
- The fifth parameter is the top margin for the "/mo" part of the arrangement (however the mixin tries to place this along the baseline automatically).
- The fifth parameter is the right margin for the "/mo" part, so it can be adjusted horizontally. It's set to be at the bottom right corner, but usually needs to be adjusted with this parameter.
SASS Mixin Code:
Simple Sticky Element
The user scrolls down the page and once the scrolling reaches the top of an element of my choosing, that element sticks to the top of the window, so it's always visible from that point on...
A Nicer Select Dropdown
Better select boxes are all over the internet, but I actually couldn't find one that I liked, and that worked for what I needed...
My Emerging CSS System
My attempt at doing CSS better.
The Built Environment