Questions tagged [class-names]
86 questions
1
vote
0 answers
Use PostCSS with react components
I am using classNames for styling my component in react, but if i use some components like react-select then how to import styles react-select/dist/react-select.min.css and use it inside my component.
import React, { Component } from 'react';
import…

Vikramaditya
- 5,444
- 6
- 34
- 45
1
vote
1 answer
Organizing Rails files within app folder for api
All setups I've found use the following folder structure
/app
/controllers
/api
/v1
/views
/api
/v1
/models
This is ok, I guess. But I am trying to get a structure that looks like
/app
/api
/v1
/controllers
/views
…

Nick Ginanto
- 31,090
- 47
- 134
- 244
1
vote
2 answers
How can I compare an object with the parent class in php?
I want to compare the class of an object with the current class, and in inherited methods to refer to the parent class. This is the only way I can think of doing it:
class foo { function compare($obj) { return get_class($obj) == get_class(new self);…

peterjwest
- 4,294
- 2
- 33
- 46
1
vote
2 answers
Array of Class Names AS3
I've got several movieclips in my FLA library with classnames applied. In my AS package file, I've got an array of those classnames. What I'd like to do is display the movieclips on stage as follows:
Upon SWF load, Array[0] displays
When NEXT…

M Cowan
- 13
- 3
0
votes
1 answer
Class Name in Windows Forms
I wonder about dynamically changing of class name in .NET application. For example WindowsForms10.SysTreeView32.app.0.19fd5c7. The last string "19fd5c7" would change, but I don't know what makes it changing. Is it the version, the GUI modification,…

oliverwood
- 243
- 4
- 6
- 11
0
votes
0 answers
Use imported styles inside classname's conditional expression
I'm working on a NextJs project. I'm using Tailwind css , along with some custom css.
I'm having the following code.
grid-images.module.scss
@media (min-width: 768px) {
.mt-md-6 {
margin-top: 3rem !important;
}
}
grid-images.tsx
import cn…

Sushant
- 123
- 8
0
votes
0 answers
JavaScript: console log shows parent class name instead of derived class name
If I declare a non-derived class, the console log shows the class name of instances:
class A {constructor(){}}
new A();
-> A {}
However, when I declare a derived class, the console log shows the parent class name instead:
class B extends…

personal_cloud
- 3,943
- 3
- 28
- 38
0
votes
2 answers
Is there a way to keep Rector from inlining class references?
I'm using the Rector ruleset UP_TO_PHP_74 to update a legacy application.
It mostly does a good job, but the problem I'm seeing a lot of is that it's changing
...
use My/Namespace/My/Classname;
...
/** @var Guestlist */
private $myVariable;
... to…

Mayor of the Plattenbaus
- 974
- 3
- 34
- 69
0
votes
0 answers
React js - ternary adding html block to component - classNames break the block
My goal is to build comment section that appears and disappears on a toggle click button.
I have the following structure:
set Button state:
const [showButton, toggleShowButton] = useState(false)
Button:
0
votes
1 answer
How to add multiple classNames to an html element when using scss in React
I have a styles.module.scss file and a react component. How can add multiple classNames from the styles to ONE html element?
Below is my code:
/styles/styles.module.scss file
.gridContainer {
display: grid;
gap: 2em;
grid-template-columns: 1fr…

myverdict
- 622
- 8
- 24
0
votes
1 answer
Applying class in next.js
Newbie here. I'm trying to convert this class
for next.js.
I can't figure out the best way to do it. Anyone can help? Thanks!!

cori6
- 29
- 3
0
votes
1 answer
How to target nested class name inside classNames? React
I need to target nested class inside clasNames.
Check my code first:
And inside CSS
.Header {
width: 100%;
.test {
width: 700px;
}
&.test--center {
background:…

MinolaT
- 1
- 4
0
votes
5 answers
jQuery period in class name stored in var
I have this code:
var imgId = this.id; //file1.jpg
and this:
$('.img\\' + imgId).remove();
So the problem is, i cant escape the '.' because its in the var, not before. What can i do?

benhowdle89
- 36,900
- 69
- 202
- 331
0
votes
2 answers
How to only select one button at a time with React? Without radio buttons
I am trying to write a quiz type module where you can select one of two answers.
const [active, setActive] = useState(true);
const toggle = () => {
setSelected(!selected)
}

Brittany Hilliard
- 27
- 3
0
votes
1 answer
Class Names and Design patterns
Today I came across some weird case when thinking about naming my classes and using the right design-patterns.
I was curious how you solve this?
So the situation is:
I got some views in general like: View-1, View-2, View-3
Each view got attributes…

Greg
- 21
- 3