![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
big-ideas-text
Advanced tools
Dynamically scale lines of text within a container. No jQuery required.
Big Ideas Text aims to be as easy to use as the original BigText. If it’s not, please open an issue. Get the latest version of the CSS file here:
Alternatively, install it with npm and use the build tool of your choice:
npm install big-ideas-text
Big Ideas Text works best on browsers that support subpixel font scaling. In order to best serve sizes to all browsers, it will adjust word-spacing
as well as font-size
.
<div id="example">
<span>Don’t get any</span>
<span>big ideas</span>
<span>They’re not gonna happen</span>
</div>
<script>
var ex = document.getElementById('example');
bigText(ex);
</script>
<ol id="example">
<li>Don’t get any</li>
<li>big ideas</li>
<li>They’re not gonna happen</li>
</ol>
<script>
var ex = document.getElementById('example');
bigText(ex);
</script>
<div id="example">
<p>Don’t get any</p>
<span>big ideas</span>
<p>They’re not gonna happen</p>
</div>
<script>
var ex = document.getElementById('example');
bigText(ex, {
childSelector: '> p'
});
</script>
<ol id="example">
<li>Don’t get any</li>
<li class="bigIdeasText-exempt">big ideas</li>
<li>They’re not gonna happen</li>
</ol>
<script>
var ex = document.getElementById('example');
bigText(ex);
</script>
<ol id="example">
<li>Don’t get any</li>
<li>
<span style="font-family: 'Avenir Next', sans-serif">big</span>
<span style="font-family: 'Georgia', serif">ideas</span>
</li>
<li>They’re not gonna happen</li>
<li></li>
</ol>
<script>
var ex = document.getElementById('example');
bigText(ex);
</script>
Also works with letter-spacing
, word-spacing
, and text-transform
.
Whatever web font service you are using, it’s likely built upon WebFontLoader. You can use its active
callback to initialise Big Ideas Text once your fonts have loaded.
<script>
WebFontConfig = {
google: { families: [ 'Fira+Sans::latin' ] },
active: function() {
var ex = document.getElementById('example')
bigText(ex);
}
};
</script>
<script async defer src="//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
<div id="example">
<span>Don’t get any</span>
<span>big ideas</span>
<span>They’re not gonna happen</span>
</div>
Shorter lines means larger text sizes. If you’d like to specify a maximum font size:
<div id="example">
<span>BIG</span>
</div>
<script>
var ex = document.getElementById('example');
bigText(ex, {
maxfontsize: 60 // Default is `528px`
});
</script>
The following span
houses a a super long line that will probably be resized to epically small proportions. A minimum font size will improve the situation.
<div id="example">
<span>Don’t get any big ideas / They’re not gonna happen / You paint yourself white / And fill up with noise / But there’ll be something missing</span>
</div>
<script>
$('#bigtext').bigtext({
minfontsize: 16 // Default is `null`
});
</script>
You have a few options if you’d like to scale text in this manner. If your text is static and unchanging, take a look at:
If your text is dynamic, I’d reccomend using this plugin. If you are already have jQuery as a dependency and don’t plan on changing that anytime soon, Zack Leatherman’s original BigText plugin might be the right option.
I’m in the process of writing a comparison of all four libraries (akin to this post). If you’d like an email when it’s done, you can sign up for my web typography newsletter.
Big Ideas Text includes its own debounced resize event.
Big Ideas Text uses an off-canvas detached node to improve performance when sizing. Setting DEBUG_MODE
to true will leave this detached node on the canvas for visual inspection for problem resolution.
var ex = document.getElementById('example');
bigText(ex).DEBUG_MODE = true;
Lines Wrapping Pre-BigText The starting font-size must be small enough to guarantee that each individual line is not wrapping pre-Big Ideas Text. If the line is too long, Big Ideas Text will not size it correctly.
Thanks for considering contributing! There’s information about how to get started with Big Ideas Text locally here.
Copyright © 2014 Kenneth Ormandy
Zack Leatherman wrote the original BigText.
Brent Jackson inspired the Radiohead-themed name
The lyrics in the examples are from Radiohead’s Nude, colloquially Big Ideas (Don’t Get Any).
Thanks to my friends and co-workers at Chloi Inc.
FAQs
Dynamically scale lines of text within a container.
The npm package big-ideas-text receives a total of 6 weekly downloads. As such, big-ideas-text popularity was classified as not popular.
We found that big-ideas-text 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 iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.