question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New 'Content' component feature

See original GitHub issue

How many times have you come across a bunch of content within a <div> or an <article> tag with a bunch of <p>, <ul> and possibly even headings and thought to yourself if only there was a simple classname I can add to the div that would prevent me having to add specific classes to all of these elements?

This is an issue I’ve come across, and whilst I’m sure Bootstrap provides some base default styling, I’m not totally convinced that this is appropriate in most projects.

I was thinking this…

To add a new component under the ‘Components’ heading on the docs (https://getbootstrap.com/docs/4.1/getting-started/introduction/) called something like: ‘Content’

The purpose of this component is to provide a simple method for styling elements within a div or article element, all the user would need to do is add a class called .content to their parent element, and elements within would be styled. I was thinking of adding support for the following HTML elements:

  • <p> paragraphs
  • <ul>, <ol> and <dl> lists
  • <h1> to <h6> headings
  • <blockquote> quotes
  • <em>, <b> and <strong> tags
  • <table> with relevant child elements of a table

What’s people’s opinion on this?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
MartijnCuppenscommented, Jun 19, 2018

@sts-ryan-holton “I think” what you’re suggesting is something like Bulma is doing here: https://bulma.io/documentation/elements/content/

The Bootstrap docs also use a .bd-content class to control spacing between headings: https://github.com/twbs/bootstrap/blob/7b2372f35319ce392cb3f6ddab7c2de879a8a354/assets/scss/_content.scss#L70-L95

I personally also use a .content class to control spacings between headings, parargraphs, lists,…

Would you also add additional theming or just use it to control spacing?

1reaction
jonathanhefnercommented, Feb 21, 2020

I like this proposal. I was trying to achieve something similar (though less specific to content / copy) in #29481.

Read more comments on GitHub >

github_iconTop Results From Across the Web

My thoughts on the new Figma Component Properties
Figma launched around 15 new features at Config, including improved Auto-Layout (gotta love that Absolute Positioning option), Variable Fonts, ...
Read more >
Understanding Figma's interactive components feature
Interactive Components is a great feature for showing interaction in standard UI components, such as buttons, switches and dropdowns. It can also be...
Read more >
Featured Content Feature | Adobe Experience Manager
The Featured Content feature lets signed-in site visitors highlight content.
Read more >
Create a feature component - Angular
This tutorial splits up large components into smaller subcomponents, each focused on a specific task or workflow. The first step is to move...
Read more >
Associating New Components with Features
Associating New Components with Features. InstallShield 2020. Project:This information applies to the following project types: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found