Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed dom-style example code #5084

Merged
merged 1 commit into from
Mar 13, 2021
Merged

Changed dom-style example code #5084

merged 1 commit into from
Mar 13, 2021

Conversation

Aloneduckling
Copy link
Contributor

Resolves #5010

Changes:

Made some changes to the example code, making them visually appealing and less cluttering.

Screenshots of the change:

image

PR Checklist

@Aloneduckling
Copy link
Contributor Author

Aloneduckling commented Mar 13, 2021

@lmccart, sorry to disturb you again and again. I wanted to know that is there any way we can pass objects to the style function.

I wanted to achieve this:

let styles, div;
function setup(){
   background(220);
   div = createDiv('text');
   
   //object which contains styles
   styles = {
      color: 'green',
      background-color: 'blue'
   }; 
   
   div.style(styles);
}

I know that currently multiple styles can be passed as a string separated with ; just like inline CSS.

Also, we can have some functionality for the use of : hover,, : active etc.

@lmccart lmccart merged commit 55af036 into processing:main Mar 13, 2021
@lmccart
Copy link
Member

lmccart commented Mar 13, 2021

@Aloneduckling I don't think that's currently possible

@Aloneduckling Aloneduckling deleted the correct-style-example branch March 15, 2021 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

p5.js Element style example is overlapping with the website text
2 participants