Coder Social home page Coder Social logo

Comments (4)

ggdaltoso avatar ggdaltoso commented on May 27, 2024

Hi, @dlomax64

I was trying to reproduce your issue and ended up with this CodeSandbox solution but it doesn't seem to solve your main problem.

In other words, you can easily extend a component style using styled-components API

import styled from "styled-components";
import { Modal } from "@react95/core";

const ExtendedModal = styled(Modal)`
  z-index: 10;
`;

But extending a component wouldn't seem to be a solution for your case.

Our Modal has its active state handled by its own Context + its own state.

The only way I can see you could achieve what you want would be by creating a new theme and changing the Modal zIndex to whichever you want. But, there is no such API for doing this.

Today, you can only choose one for a bunch of available themes. You can't build your own.

We could create a task for it. If you want to.

Would you like to contribute to it?

Although, if you could provide more details of what are you facing I would be glad to help you.

from react95.

sylviesworld avatar sylviesworld commented on May 27, 2024

My specific problem is that I have an animated svg on the background that the modal falls behind whenever it goes out of focus. Whenever I try to alter the modals z-index, the in-focus modal won't always appear above out of focus windows. The problem with the method you posted is that it makes the z-index for the modal 10 whether it's in focus or not.

I wonder if you could make it to where you can pass a z-index (for it's in and out of focus states) to the modal like you do with height and width. Or perhaps have an option that makes the out of focus modal's z-index always be the in-focus z-index - 1.

I've never modified a package before, so if I were to play around with that would modifying node_modules/@react95/core/@types/Modal/Modal.d.ts be how I do it?

Thanks for the help

from react95.

sylviesworld avatar sylviesworld commented on May 27, 2024

I feel real silly right now. I finally determined why the windows kept falling behind my svg even though they had the same z-index. I was rendering the windows before the svg. Simply switching the order that my elements get rendered fixed it. Thanks for trying to help!

from react95.

ggdaltoso avatar ggdaltoso commented on May 27, 2024

I'm glad to know you could solve this!

But feel free to contribute with React95. I would love to discuss and help you with an issue or feature.

Thanks, @dlomax64

from react95.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.