diff --git a/site/app/(marketing)/blog/[slug]/page.tsx b/site/app/(marketing)/blog/[slug]/page.tsx index 513be0c3ee219805d8726d9c93353bbe93f23933..7c148fc763d612dfbde219e10682752c4435bd48 100644 --- a/site/app/(marketing)/blog/[slug]/page.tsx +++ b/site/app/(marketing)/blog/[slug]/page.tsx @@ -2,7 +2,9 @@ import { notFound } from 'next/navigation'; import { allPosts } from 'contentlayer/generated'; import Mdx from '@/components/MDX'; -import { Ad } from '@/components/Ad'; +import Ad from '@/components/Ad'; +import Link from '@/components/Link'; +import Icon from '@/components/Icon'; interface PageProps { params: { @@ -38,41 +40,36 @@ export default async function PostPage({ params }: PageProps) { <>
+
+ {post && post.title && ( +
+ {post.product &&
{post.product}
} +
July 25, 2023
+

{post.title}

+
+ )} +
+
-
+
-
back
+ + + Go back + +
+
+
+
+ {post.description &&

{post.description}

} +
-
-
-
-
- {post && post.title && ( -
- {post.product &&
{post.product}
} -
July 25, 2023
-

{post.title}

-
- )} -
-
-
-
-
-
-
-
- {post.description &&

{post.description}

} - -
-
-
-
- -
-
+
+
+
+
diff --git a/site/app/(marketing)/blog/page.tsx b/site/app/(marketing)/blog/page.tsx index 862322342d30f59bc60a08fa744b14fb9a8f6078..51a65d8b37901960686aa05cb71dcff264590d0d 100644 --- a/site/app/(marketing)/blog/page.tsx +++ b/site/app/(marketing)/blog/page.tsx @@ -1,5 +1,8 @@ +import Icon from '@/components/Icon'; +import { iconsUrl } from '@/config/site'; import Link from 'components/Link'; import { allPosts } from 'contentlayer/generated'; +import { format } from 'date-fns'; export const metadata = { title: 'Blog', @@ -7,88 +10,69 @@ export const metadata = { }; export default async function BlogPage() { - return ( <> -
- {allPosts.map((post, i) => ( -
-
- {/* -
{format(new Date(post.date), "d")}
-
{format(new Date(post.date), "MMM")}
*/} -
-
- {post.image && ( - -
- {post.title} -
- - )} -
- {post.title && ( -

- - - {post?.title} -

- )} +
+
+

Blog

+

+ Stay in the loop with all things Tabler and Tabler Icons. Regular updates on new features, changelogs, and news, ensuring you never miss any of our software developments. +

+
+
+
+
+
+ {allPosts.map((post, i) => ( +
+ {post.image && ( + +
+ {post.title} +
+ + )} +
+ {post.title && ( +

+ + + {post?.title} +

+ )} -
-

{post.summary}

-
-
+
+

{post.description}

+
+
-
-
-
- + ))}
- ))} -
+
+
+ +
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis quibusdam quos est repellat rerum molestias, autem ullam, exercitationem magni non eos sunt, voluptates laboriosam dignissimos mollitia tempora ipsum illo + adipisci. +
+
); } diff --git a/site/components/Ad.tsx b/site/components/Ad.tsx index a3d08dc417d963b94a98bdc0e893e9b66ed91f62..6dd96f998faecffa07bdc7430ac94d471924c5d4 100644 --- a/site/components/Ad.tsx +++ b/site/components/Ad.tsx @@ -1,12 +1,15 @@ 'use client'; +import clsx from 'clsx'; import { useRef, useEffect } from 'react'; -export const Ad = () => { +export default function Ad({ className, horizontal }: { className?: string; horizontal?: boolean }) { const ad = useRef(null); useEffect(() => { if (ad.current) { + ad.current.innerHTML = ''; + const script = document.createElement('script'); script.async = true; script.src = '//cdn.carbonads.com/carbon.js?serve=CWYDCKQE&placement=tabler-iconsio'; @@ -15,7 +18,5 @@ export const Ad = () => { } }, []); - return ( -
- ); + return
; }; diff --git a/site/components/Icon.tsx b/site/components/Icon.tsx index 8d0b7451ccfebd1ec4c5193d3ec1f3332eaadfb0..1611156edcf62f4976020fdacf36a388d273f695 100644 --- a/site/components/Icon.tsx +++ b/site/components/Icon.tsx @@ -4,10 +4,7 @@ const icons = { plus: ({ className }) => ( ( ( ), + 'arrow-right': ({ className }) => ( + + + + + + ), 'thumb-up': ({ className }) => ( ( ( ( ( ` usually) and accessible by any element throughout the DOM. + +- **Component variables —** Variables scoped specifically to each component, usually on the component's base class, and their modifier classes and Sass mixins. + +- **Utility variables —** Used as modifiers within other utility classes. + +Regardless of where they are, all of our CSS variables are prefixed with `--bs-`, so you know where they're coming from and how they might be used across codebases that mix Bootstrap's CSS with additional custom styles. You'll also notice that we don't put all our component variables at the root level. This keeps CSS variables scoped to their intended use cases and prevents polluted variables in the global `:root` scope. + +It's also worth mentioning two larger efforts that are still to come around CSS variables: + +1. Adding CSS variables to all our forms +2. Adding more nuanced global theme variables and support for color modes like [dark mode](https://github.com/twbs/bootstrap/pull/35857). + +These are likely coming in v5.3.0 (our next minor release after v5.2.0 stablizes), so in the mean time, check out the GitHub repo to see how things are shaping up. + +## Root variables + +![Root variables in web inspector](/assets/img/2022/05/docs-root-vars.png) + +Bootstrap has a ton of [root variables](https://getbootstrap.com/docs/5.2/customize/css-variables/#root-variables) and we'll only be adding more in future updates for the aforementioned color mode support. As of this post, we have the following CSS variables on the `:root` element: + +- **Colors —** All named colors, gray colors, and theme colors. This also includes all our `$theme-colors` in their `rgb` format. + +- **Body font styles —** Everything from `font-size` to `color` and more, all applied to our `` element. + +- **Shared properties —** For property-value pairings that we consider theme specific, like link colors and border styles. + +Root CSS variables are used extensively across other parts of Bootstrap to allow you to easily override our default styles at a global level. For example, if you wanted to adjust the default `border-radius` and link color for our components, you could override a couple variables instead of writing new selectors. + +```scss +// custom.css +:root { + --bs-border-radius: .5rem; + --bs-link-color: #333; +} +``` + +You can even use other root variables to override those values: + +```scss +// custom.css +:root { + --bs-border-radius: var(--bs-border-radius-lg); + --bs-link-color: var(--bs-gray-800); +} +``` + +Without CSS variables, you'd have to use a preprocessor like Sass or write new selectors for every instance of these properties across all components. The former is relatively easy, the latter not so much. CSS variables help solve that. + +## Component variables + +On our components, CSS variables get even more power for customizing. Nearly everything under the Components section in our docs sidebar now has CSS variables available to you: + +- [Accordion](https://getbootstrap.com/docs/5.2/components/accordion/) +- [Alerts](https://getbootstrap.com/docs/5.2/components/alerts/) +- [Badge](https://getbootstrap.com/docs/5.2/components/badge/) +- [Breadcrumb](https://getbootstrap.com/docs/5.2/components/breadcrumb/) +- [Buttons](https://getbootstrap.com/docs/5.2/components/buttons/) +- [Button group](https://getbootstrap.com/docs/5.2/components/button-group/) +- [Card](https://getbootstrap.com/docs/5.2/components/card/) +- [Carousel](https://getbootstrap.com/docs/5.2/components/carousel/) +- [Collapse](https://getbootstrap.com/docs/5.2/components/collapse/) +- [Dropdowns](https://getbootstrap.com/docs/5.2/components/dropdowns/) +- [List group](https://getbootstrap.com/docs/5.2/components/list-group/) +- [Modal](https://getbootstrap.com/docs/5.2/components/modal/) +- [Navbar](https://getbootstrap.com/docs/5.2/components/navbar/) +- [Navs & tabs](https://getbootstrap.com/docs/5.2/components/navs-tabs/) +- [Offcanvas](https://getbootstrap.com/docs/5.2/components/offcanvas/) +- [Pagination](https://getbootstrap.com/docs/5.2/components/pagination/) +- [Placeholders](https://getbootstrap.com/docs/5.2/components/placeholders/) +- [Popovers](https://getbootstrap.com/docs/5.2/components/popovers/) +- [Progress](https://getbootstrap.com/docs/5.2/components/progress/) +- [Spinners](https://getbootstrap.com/docs/5.2/components/spinners/) +- [Toasts](https://getbootstrap.com/docs/5.2/components/toasts/) +- [Tooltips](https://getbootstrap.com/docs/5.2/components/tooltips/) + +_Scrollspy and close button have no relevant CSS variables, so they're excluded here._ + +Throughout our documentation you'll find examples of customizing our default components by overriding their CSS variables. One great example comes from our own docs where we write our own button styles to [create a purple button](https://getbootstrap.com/docs/5.2/components/buttons/#variables). + +```css +.btn-bd-primary { + --bs-btn-font-weight: 600; + --bs-btn-color: var(--bs-white); + --bs-btn-bg: var(--bd-violet); + --bs-btn-border-color: var(--bd-violet); + --bs-btn-border-radius: .5rem; + --bs-btn-hover-color: var(--bs-white); + --bs-btn-hover-bg: #{shade-color($bd-violet, 10%)}; + --bs-btn-hover-border-color: #{shade-color($bd-violet, 10%)}; + --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb); + --bs-btn-active-color: var(--bs-btn-hover-color); + --bs-btn-active-bg: #{shade-color($bd-violet, 20%)}; + --bs-btn-active-border-color: #{shade-color($bd-violet, 20%)}; +} +``` + +Which looks like this: + +![Custom Bootstrap docs button](/assets/img/2022/05/docs-custom-button.png) + +Another great example is from [our tooltips](https://getbootstrap.com/docs/5.2/components/tooltips/#custom-tooltips). You can add custom classes to tooltips and popovers in Bootstrap with `data-bs-custom-class="custom-tooltip"`. Then, with one CSS variable, you can change the tooltip background and arrow color. + +```css +.custom-tooltip { + --bs-tooltip-bg: var(--bs-primary); +} +``` + +Which looks like this: + +![Custom tooltip](/assets/img/2022/05/docs-custom-tooltip.png) + +There are dozens of CSS variables in play across our components. All of them are referenced in a new section on the relevant docs page. For example, [here are our modal CSS variables](https://getbootstrap.com/docs/5.2/components/modal/#variables). This is in addition to all the Sass variables, mixins, loops, and maps used for each component. + +## Utility variables + +Not every utility class uses CSS variables, but the ones that do gain a good amount of power and customization. [Background](https://getbootstrap.com/docs/5.2/utilities/background/), [border](https://getbootstrap.com/docs/5.2/utilities/borders/), and [color](https://getbootstrap.com/docs/5.2/utilities/colors/) utilities all have what we call "local CSS variables" to improve their usefulness. Each of them uses CSS variables to customize the alpha transparency value of `rgba()` colors. + +Consider our [background color utilities](https://getbootstrap.com/docs/5.2/utilities/background/), `.bg-*`. By default each utility class has a local variable, `--bs-bg-opacity` with a default value of `1`. To change the background utility alpha value, you can override that value with your own styles, or some new `.bg-opacity-*` utilities. + +```html +
+ ... +
+``` + +Here's how `.bg-success` looks with all our `.bg-opacity-*` classes applied: + +![Background opacity examples](/assets/img/2022/05/bg-opacity.png) + +And the same is available for [border color opacity](https://getbootstrap.com/docs/5.2/utilities/borders/#opacity) (`--bs-border-opacity` and `.border-opacity-*`) and [text color opacity](https://getbootstrap.com/docs/5.2/utilities/colors/#opacity) (`--bs-text-opacity` and `.text-opacity-*`). So many color options are now available with these utilities. + +By default, we ship with five values for these various opacity utilities. + +| Class names | Alpha value | +| --- | --- | +| `.text-opacity-10`
`.bg-opacity-10`
`.border-opacity-10` | `.1` | +| `.text-opacity-25`
`.bg-opacity-25`
`.border-opacity-25` | `.25` | +| `.text-opacity-50`
`.bg-opacity-50`
`.border-opacity-50` | `.5` | +| `.text-opacity-75`
`.bg-opacity-75`
`.border-opacity-75` | `.75` | +| `.text-opacity-100`
`.bg-opacity-100`
`.border-opacity-100` | `1` | + +Expect more CSS variables to make their way into our utilities. There's a lot of power in real-time customization, even for what we consider immutable styles. + +--- + +**Ready to get started with Bootstrap?** Checkout the [quick start guide](https://getbootstrap.com/docs/5.2/getting-started/introduction/#quick-start) so you can put these new CSS variables to work in your next project! diff --git a/site/content/blog/test.mdx b/site/content/blog/test.mdx index b82800e72d67ee1addf787933061de217839a227..9ff67da2eb5ac9cef417a181c27e385feb37d91d 100644 --- a/site/content/blog/test.mdx +++ b/site/content/blog/test.mdx @@ -1,184 +1,49 @@ --- -author: mdo date: "2022-05-16T00:00:00Z" -title: Random Blog Post from Bootstrap +title: Marge, just about everything's a sin. Y'ever sat down and read this thing? +description: How is education supposed to make me feel smarter? Besides, every time I learn something new, it pushes some old stuff out of my brain. Remember when I took that home winemaking course, and I forgot how to drive? Books are useless! I only ever read one book, "To Kill A Mockingbird," and it gave me absolutely no insight on how to kill mockingbirds! Sure it taught me not to judge a man by the color of his skin…but what good does *that* do me? +image: tabler-icons-2.29.0@2x.png keywords: - bootstrap - guide --- -[Bootstrap v5.2.0-beta1](/2022/05/13/bootstrap-5-2-0-beta/) added a slew of CSS custom properties, or CSS variables, across the `:root` level and all our core components. Here's a quick look at how you can utilize them in your projects. +Yes! I am a citizen! Now which way to the welfare office? I'm kidding, I'm kidding. __I work, I work.__ *Oh, loneliness and cheeseburgers are a dangerous mix.* Your guilty consciences may make you vote Democratic, but secretly you all yearn for a Republican president to lower taxes, brutalize criminals, and rule you like a king! -With CSS variables, you can now customize Bootstrap easier than ever, and without the need for a CSS preprocessor. All the power of Sass is still there behind the scenes, but CSS variables adds a ton of power for the future. Use and compose new values, updates styles globally without recompiling, set fallback values, setup new color modes, and more. +## …And the fluffy kitten played with that ball of string all through the night. On a lighter note, a Kwik-E-Mart clerk was brutally murdered last night. -Let's dig in. +Oh, loneliness and cheeseburgers are a dangerous mix. Please do not offer my god a peanut. We started out like Romeo and Juliet, but it ended up in tragedy. Remember the time he ate my goldfish? And you lied and said I never had goldfish. Then why did I have the bowl, Bart? *Why did I have the bowl?* -## CSS variables? +1. Jesus must be spinning in his grave! +2. Human contact: the final frontier. +3. Last night's "Itchy and Scratchy Show" was, without a doubt, the worst episode *ever.* Rest assured, I was on the Internet within minutes, registering my disgust throughout the world. -Their official name is custom properties, but they're often referred to as CSS variables thanks to their most immediate use case for setting specific values. Consider reading [the MDN CSS custom properties article](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties#first_steps_with_custom_properties) or [the CSS Tricks guide](https://css-tricks.com/a-complete-guide-to-custom-properties/) if you need a primer. +### Get ready, skanks! It's time for the truth train! -In a nutshell, CSS variables allow you to name frequently used values. For example, instead of writing `#6f42c1` everywhere, you can set `--purple: #6f42c1`. Then you can use that variable later on with the `var()` function. +We started out like Romeo and Juliet, but it ended up in tragedy. I don't like being outdoors, Smithers. For one thing, there's too many fat children. And here I am using my own lungs like a sucker. How is education supposed to make me feel smarter? Besides, every time I learn something new, it pushes some old stuff out of my brain. Remember when I took that home winemaking course, and I forgot how to drive? -```css -:root { - --purple: #6f42c1; -} -.custom-element { - color: var(--purple); -} -``` +* Oh, so they have Internet on computers now! +* You don't win friends with salad. +* Marge, you being a cop makes you the man! Which makes me the woman — and I have no interest in that, besides occasionally wearing the underwear, which as we discussed, is strictly a comfort thing. -We use CSS variables in Bootstrap to set many property values globally, across our components, and in some of our utilities. +…And the fluffy kitten played with that ball of string all through the night. On a lighter note, a Kwik-E-Mart clerk was brutally murdered last night. Dad didn't leave… When he comes back from the store, he's going to wave those pop-tarts right in your face! -## Groups of variables +Fat Tony is a cancer on this fair city! He is the cancer and I am the…uh…what cures cancer? Yes! I am a citizen! Now which way to the welfare office? I'm kidding, I'm kidding. I work, I work. -When we talk about CSS variables in Bootstrap, we're referring to three major groups: +Kids, we need to talk for a moment about Krusty Brand Chew Goo Gum Like Substance. We all knew it contained spider eggs, but the hantavirus? That came out of left field. So if you're experiencing numbness and/or comas, send five dollars to antidote, PO box… Old people don't need companionship. They need to be isolated and studied so it can be determined what nutrients they have that might be extracted for our personal use. -- **Root variables —** Globally scoped variables available on the `:root` element (`` usually) and accessible by any element throughout the DOM. +I can't go to juvie. They use guys like me as currency. Attempted murder? Now honestly, what is that? Do they give a Nobel Prize for attempted chemistry? Ahoy hoy? Stan Lee never left. I'm afraid his mind is no longer in mint condition. -- **Component variables —** Variables scoped specifically to each component, usually on the component's base class, and their modifier classes and Sass mixins. +Books are useless! I only ever read one book, "To Kill A Mockingbird," and it gave me absolutely no insight on how to kill mockingbirds! Sure it taught me not to judge a man by the color of his skin…but what good does *that* do me? Old people don't need companionship. They need to be isolated and studied so it can be determined what nutrients they have that might be extracted for our personal use. -- **Utility variables —** Used as modifiers within other utility classes. +Son, a woman is like a beer. They smell good, they look good, you'd step over your own mother just to get one! But you can't stop at one. You wanna drink another woman! Donuts. Is there anything they can't do? -Regardless of where they are, all of our CSS variables are prefixed with `--bs-`, so you know where they're coming from and how they might be used across codebases that mix Bootstrap's CSS with additional custom styles. You'll also notice that we don't put all our component variables at the root level. This keeps CSS variables scoped to their intended use cases and prevents polluted variables in the global `:root` scope. +Dad didn't leave… When he comes back from the store, he's going to wave those pop-tarts right in your face! Mrs. Krabappel and Principal Skinner were in the closet making babies and I saw one of the babies and then the baby looked at me. -It's also worth mentioning two larger efforts that are still to come around CSS variables: +The Internet King? I wonder if he could provide faster nudity… A lifetime of working with nuclear power has left me with a healthy green glow…and left me as impotent as a Nevada boxing commissioner. -1. Adding CSS variables to all our forms -2. Adding more nuanced global theme variables and support for color modes like [dark mode](https://github.com/twbs/bootstrap/pull/35857). +Dear Mr. President, There are too many states nowadays. Please, eliminate three. P.S. I am not a crackpot. The Internet King? I wonder if he could provide faster nudity… But, Aquaman, you cannot marry a woman without gills. You're from two different worlds… Oh, I've wasted my life. -These are likely coming in v5.3.0 (our next minor release after v5.2.0 stablizes), so in the mean time, check out the GitHub repo to see how things are shaping up. +Books are useless! I only ever read one book, "To Kill A Mockingbird," and it gave me absolutely no insight on how to kill mockingbirds! Sure it taught me not to judge a man by the color of his skin…but what good does *that* do me? He didn't give you gay, did he? Did he?! -## Root variables - -![Root variables in web inspector](/assets/img/2022/05/docs-root-vars.png) - -Bootstrap has a ton of [root variables](https://getbootstrap.com/docs/5.2/customize/css-variables/#root-variables) and we'll only be adding more in future updates for the aforementioned color mode support. As of this post, we have the following CSS variables on the `:root` element: - -- **Colors —** All named colors, gray colors, and theme colors. This also includes all our `$theme-colors` in their `rgb` format. - -- **Body font styles —** Everything from `font-size` to `color` and more, all applied to our `` element. - -- **Shared properties —** For property-value pairings that we consider theme specific, like link colors and border styles. - -Root CSS variables are used extensively across other parts of Bootstrap to allow you to easily override our default styles at a global level. For example, if you wanted to adjust the default `border-radius` and link color for our components, you could override a couple variables instead of writing new selectors. - -```scss -// custom.css -:root { - --bs-border-radius: .5rem; - --bs-link-color: #333; -} -``` - -You can even use other root variables to override those values: - -```scss -// custom.css -:root { - --bs-border-radius: var(--bs-border-radius-lg); - --bs-link-color: var(--bs-gray-800); -} -``` - -Without CSS variables, you'd have to use a preprocessor like Sass or write new selectors for every instance of these properties across all components. The former is relatively easy, the latter not so much. CSS variables help solve that. - -## Component variables - -On our components, CSS variables get even more power for customizing. Nearly everything under the Components section in our docs sidebar now has CSS variables available to you: - -- [Accordion](https://getbootstrap.com/docs/5.2/components/accordion/) -- [Alerts](https://getbootstrap.com/docs/5.2/components/alerts/) -- [Badge](https://getbootstrap.com/docs/5.2/components/badge/) -- [Breadcrumb](https://getbootstrap.com/docs/5.2/components/breadcrumb/) -- [Buttons](https://getbootstrap.com/docs/5.2/components/buttons/) -- [Button group](https://getbootstrap.com/docs/5.2/components/button-group/) -- [Card](https://getbootstrap.com/docs/5.2/components/card/) -- [Carousel](https://getbootstrap.com/docs/5.2/components/carousel/) -- [Collapse](https://getbootstrap.com/docs/5.2/components/collapse/) -- [Dropdowns](https://getbootstrap.com/docs/5.2/components/dropdowns/) -- [List group](https://getbootstrap.com/docs/5.2/components/list-group/) -- [Modal](https://getbootstrap.com/docs/5.2/components/modal/) -- [Navbar](https://getbootstrap.com/docs/5.2/components/navbar/) -- [Navs & tabs](https://getbootstrap.com/docs/5.2/components/navs-tabs/) -- [Offcanvas](https://getbootstrap.com/docs/5.2/components/offcanvas/) -- [Pagination](https://getbootstrap.com/docs/5.2/components/pagination/) -- [Placeholders](https://getbootstrap.com/docs/5.2/components/placeholders/) -- [Popovers](https://getbootstrap.com/docs/5.2/components/popovers/) -- [Progress](https://getbootstrap.com/docs/5.2/components/progress/) -- [Spinners](https://getbootstrap.com/docs/5.2/components/spinners/) -- [Toasts](https://getbootstrap.com/docs/5.2/components/toasts/) -- [Tooltips](https://getbootstrap.com/docs/5.2/components/tooltips/) - -_Scrollspy and close button have no relevant CSS variables, so they're excluded here._ - -Throughout our documentation you'll find examples of customizing our default components by overriding their CSS variables. One great example comes from our own docs where we write our own button styles to [create a purple button](https://getbootstrap.com/docs/5.2/components/buttons/#variables). - -```css -.btn-bd-primary { - --bs-btn-font-weight: 600; - --bs-btn-color: var(--bs-white); - --bs-btn-bg: var(--bd-violet); - --bs-btn-border-color: var(--bd-violet); - --bs-btn-border-radius: .5rem; - --bs-btn-hover-color: var(--bs-white); - --bs-btn-hover-bg: #{shade-color($bd-violet, 10%)}; - --bs-btn-hover-border-color: #{shade-color($bd-violet, 10%)}; - --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb); - --bs-btn-active-color: var(--bs-btn-hover-color); - --bs-btn-active-bg: #{shade-color($bd-violet, 20%)}; - --bs-btn-active-border-color: #{shade-color($bd-violet, 20%)}; -} -``` - -Which looks like this: - -![Custom Bootstrap docs button](/assets/img/2022/05/docs-custom-button.png) - -Another great example is from [our tooltips](https://getbootstrap.com/docs/5.2/components/tooltips/#custom-tooltips). You can add custom classes to tooltips and popovers in Bootstrap with `data-bs-custom-class="custom-tooltip"`. Then, with one CSS variable, you can change the tooltip background and arrow color. - -```css -.custom-tooltip { - --bs-tooltip-bg: var(--bs-primary); -} -``` - -Which looks like this: - -![Custom tooltip](/assets/img/2022/05/docs-custom-tooltip.png) - -There are dozens of CSS variables in play across our components. All of them are referenced in a new section on the relevant docs page. For example, [here are our modal CSS variables](https://getbootstrap.com/docs/5.2/components/modal/#variables). This is in addition to all the Sass variables, mixins, loops, and maps used for each component. - -## Utility variables - -Not every utility class uses CSS variables, but the ones that do gain a good amount of power and customization. [Background](https://getbootstrap.com/docs/5.2/utilities/background/), [border](https://getbootstrap.com/docs/5.2/utilities/borders/), and [color](https://getbootstrap.com/docs/5.2/utilities/colors/) utilities all have what we call "local CSS variables" to improve their usefulness. Each of them uses CSS variables to customize the alpha transparency value of `rgba()` colors. - -Consider our [background color utilities](https://getbootstrap.com/docs/5.2/utilities/background/), `.bg-*`. By default each utility class has a local variable, `--bs-bg-opacity` with a default value of `1`. To change the background utility alpha value, you can override that value with your own styles, or some new `.bg-opacity-*` utilities. - -```html -
- ... -
-``` - -Here's how `.bg-success` looks with all our `.bg-opacity-*` classes applied: - -![Background opacity examples](/assets/img/2022/05/bg-opacity.png) - -And the same is available for [border color opacity](https://getbootstrap.com/docs/5.2/utilities/borders/#opacity) (`--bs-border-opacity` and `.border-opacity-*`) and [text color opacity](https://getbootstrap.com/docs/5.2/utilities/colors/#opacity) (`--bs-text-opacity` and `.text-opacity-*`). So many color options are now available with these utilities. - -By default, we ship with five values for these various opacity utilities. - -| Class names | Alpha value | -| --- | --- | -| `.text-opacity-10`
`.bg-opacity-10`
`.border-opacity-10` | `.1` | -| `.text-opacity-25`
`.bg-opacity-25`
`.border-opacity-25` | `.25` | -| `.text-opacity-50`
`.bg-opacity-50`
`.border-opacity-50` | `.5` | -| `.text-opacity-75`
`.bg-opacity-75`
`.border-opacity-75` | `.75` | -| `.text-opacity-100`
`.bg-opacity-100`
`.border-opacity-100` | `1` | - -Expect more CSS variables to make their way into our utilities. There's a lot of power in real-time customization, even for what we consider immutable styles. - ---- - -**Ready to get started with Bootstrap?** Checkout the [quick start guide](https://getbootstrap.com/docs/5.2/getting-started/introduction/#quick-start) so you can put these new CSS variables to work in your next project! +Marge, you being a cop makes you the man! Which makes me the woman — and I have no interest in that, besides occasionally wearing the underwear, which as we discussed, is strictly a comfort thing. You know, the one with all the well meaning rules that don't work out in real life, uh, Christianity. diff --git a/site/next.config.mjs b/site/next.config.mjs index 744c7614efffdcf8d293fe71e5542957e6facbc9..17694dbea9852c2828cef6814cebc32cd7b3b616 100644 --- a/site/next.config.mjs +++ b/site/next.config.mjs @@ -3,7 +3,7 @@ import fs from 'fs-extra' /** @type {import('next').NextConfig} */ const nextConfig = { - reactStrictMode: true, + reactStrictMode: false, images: { domains: ["avatars.githubusercontent.com"], }, diff --git a/site/public/img/blog/tabler-icons-2.29.0@2x.png b/site/public/img/blog/tabler-icons-2.29.0@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..c94a45d60915fb2ee8f57855e83975610eb0dab4 Binary files /dev/null and b/site/public/img/blog/tabler-icons-2.29.0@2x.png differ diff --git a/site/public/img/blog/tabler-icons-2.30.0@2x.png b/site/public/img/blog/tabler-icons-2.30.0@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..f71cdb8e5a5bf7d343ab8a95cb3ff9d6eb6b4c67 Binary files /dev/null and b/site/public/img/blog/tabler-icons-2.30.0@2x.png differ diff --git a/site/styles/_ads.scss b/site/styles/_ads.scss new file mode 100644 index 0000000000000000000000000000000000000000..be835168015b0c3999945e82c3fa5a9cf5e16609 --- /dev/null +++ b/site/styles/_ads.scss @@ -0,0 +1,40 @@ +.carbon { + position: relative; + background: #{$color-gray}; + padding: 15px; + font-size: 0.8125rem; + line-height: 1.4; + border-radius: $border-radius; +} + +.carbon-img { + display: block; +} + +.carbon-text { + display: block; + margin-top: 0.75rem; + color: $color-text; + font-weight: 500; +} + +.carbon-poweredby { + display: block; + margin-top: 0.75rem; + color: $color-muted; +} + +.carbon-horizontal { + min-height: 130px; + padding-left: 160px; + + .carbon-img { + position: absolute; + top: 15px; + left: 15px; + } + + .carbon-text { + margin: 0; + } +} diff --git a/site/styles/_config.scss b/site/styles/_config.scss index 4511bf537c914b074ca36dcef2c571afbeb72a42..c59eb409231ae7365d210e8719d1bf6e7c0cf44e 100644 --- a/site/styles/_config.scss +++ b/site/styles/_config.scss @@ -166,7 +166,7 @@ $grid-breakpoints: ( $container-max-width: px2rem(1280px); $container-narrow-max-width: px2rem(990px); -$container-slim-max-width: px2rem(768px); +$container-slim-max-width: px2rem(660px); $zindex-modal: 100; $zindex-gototop: 90; @@ -468,6 +468,14 @@ $utilities: ( light: 1px solid $color-border-light ) ), + "outline": ( + property: outline, + values: ( + 0: none, + null: 1px solid $color-border, + light: 1px solid $color-border-light + ) + ), "border-top": ( property: border-top, values: ( diff --git a/site/styles/_guides.scss b/site/styles/_guides.scss index b580b529697d08591aa7cd45fe3b361045d5c610..9eb6b67c0db50167836a9ccf8e607d1e4fef7e78 100644 --- a/site/styles/_guides.scss +++ b/site/styles/_guides.scss @@ -35,7 +35,7 @@ position: absolute; top: 2rem; z-index: 1; - background: $color-gray; + background: $color-white; color: $color-muted-light; left: calc(4rem / -2 - 1rem); text-transform: uppercase; diff --git a/site/styles/_mixins.scss b/site/styles/_mixins.scss index f51a9e56df4428f3b7a60a6e384d460e1b236404..aed6c6c330b6ba1fceeab9fc9333e2837630c9d2 100644 --- a/site/styles/_mixins.scss +++ b/site/styles/_mixins.scss @@ -260,6 +260,16 @@ width: 12rem; } + .#{$prefix}col-slim { + flex: 0 0 auto; + width: calc(#{$container-slim-max-width} + var(--gutter-x)) + } + + .#{$prefix}col-narrow { + flex: 0 0 auto; + width: calc(#{$container-narrow-max-width} + var(--gutter-x)); + } + @if $columns > 0 { @for $i from 1 through $columns { .#{$prefix}col-#{$i} { diff --git a/site/styles/website.scss b/site/styles/website.scss index f5060a606b51ae69c335dc6d0e01e29db9083069..125b543a818062b95a9ef4c0f82885c8976f9e7f 100644 --- a/site/styles/website.scss +++ b/site/styles/website.scss @@ -14,6 +14,7 @@ @import 'logo'; @import 'hero'; +@import 'ads'; @import 'avatars'; @import 'badges'; @import 'breadcrumb';