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.

Styling inside components

See original GitHub issue

I have used the background image like this:

---
<Image src='https://farm5.staticflickr.com/4810/31993107578_77df74653c_k_d.jpg' alt='comenzando' />

# That's me!

After importing the component. The image is OK, but I can’t seem to get the text right on the page, either it’s on top or on the bottom. Can it be shown centered?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
tomwaysoncommented, Jan 9, 2019

It is now in the image, but the style is not the same as the rest of the deck. I’m using h1, it gets the font right, but not the size; it’s also on the top of the page.

I’m having almost exactly the same issue.

For example, w/ the dark theme (so that the text will be visible over the image) and this code:

import { Image } from 'mdx-deck'

<Image src="https://images.unsplash.com/photo-1462331940025-496dfbfc7564?w=2048&q=20">

# Slide title
Some text
</Image>

I get this:

image

Note how the slide content is not centered vertically and that there is a 1em margin above the image.

Where as with:

# Slide title
Some text

I get:

image

How can I set the background image for a slide and have the text content be vertically centered the way it would otherwise. Should I be using a custom layout instead?

1reaction
JJcommented, Nov 14, 2018

Thanks. It is now in the image, but the style is not the same as the rest of the deck. I’m using h1, it gets the font right, but not the size; it’s also on the top of the page. Does it have different styling then?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Styling Components In React - Smashing Magazine
styled -components is a library for React and React Native that allows you to use component-level styles in your application that are written ......
Read more >
Basics - styled-components
Automatic critical CSS: styled-components keeps track of which components are rendered on a page and injects their styles and nothing else, fully automatically....
Read more >
Component styles - Angular
Sometimes it's useful to apply styles to elements within a component's template based on some condition in an element that is an ancestor...
Read more >
4. Four ways to style react components | by Agata Krzywda
There are four different options to style React components. All depend on your personal preferences and the specific complexity of your application.
Read more >
8 Ways to Style React Components - GeeksforGeeks
style components is a third party package using which we can create a component as a JavaScript variable that is already styled with...
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