Custom CSS Code Generator

Project URL: https://trail-lofty-waltz.glitch.me/

It’s a Website that Automatically generates CSS Codes for your website; however it is not complete yet - and i am still working on adding more functions soon, do you guys have any suggestions on what i can add?

7 Likes

This is cool, but whats the .my-element part :laughing:

Yeah, i am working on a function to add elements and modify their properties. :stuck_out_tongue:

They are called properties @no_one

Thanks for your opinion. I appreciate it, but this is just a project made for fun - i don’t want to use it for serious purposes. It’s just a small experiment i am trying to do.

also making new elements would require a lot of JS just so you know at your knowledge level unless if you have something to duplicate that you throw off to the side

I actually have a better idea instead of duplicating elements - I can still do big things with small knowledge, y’know!

1 Like

Quick question: What other fonts are supported in CSS?
I wanna add more fonts to the custom font thing

Edit: Nevermind

You could add a system font option.
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;

1 Like

Huh? I don’t understand what you mean.

It sets the websites font to the systems preferred font (eg, if i was on an iphone it would show the ios system font), i was saying you could add it to one of the font options.

Oh, so this will set the font to the OS Default?

font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;

yes

Ok, cool. I will add it as “Default”

Done, it’s updated. And also, i’ve MASSIVELY enlarged it - i am trying to do some code that will automatically enlarge the <div> to fit the code.

Hey, background-images must be enclosed with a url('') tag, like if you want to use https://domain.tld/folder/image.png as a background image, then you would use: url('https://domain.tld/folder/image.png')

Oh, i forgot :laughing:

1 Like

Ok, i fixed it. Try it now!

1 Like

Oh, the url must be in single quotes.

Why do i make so many mistakes?
There, fixed!

Also, the CSS code gen doesn’t work. Like you got all of the fonts wrong except for the System default which should actually be named OS default.

It is “Comic Sans MS” and “Arial”

@code-alt I would appreciate it if instead of criticizing @no_one’s code, you could point out politely how @no_one can make it better. :upside_down_face:

5 Likes

Thanks @khalby786 :slight_smile:
Now i’ll try to make a system that removes the <br> (a. k. a the blank lines) when an option isn’t selected.

Done, now the blank lines will be removed when an option is unchecked. This took me hours, LOL!

wat

image

I know :laughing:
It’s a system for removing blank lines. So i assigned an ID to each individual <br> tag and it displays them when a checkbox is ticked, but hides them when it’s unticked.

Why don’t you do

function show(x) {
return document.getElementById(x).style.display = "block"
}

and such

Can’t you just loop over all the elements in document.getElementsByTagName("br")?

You can’t apply a style to multiple elems at once with that right?

Well, i don’t seem to know how to work with that command.

Do you know how to use the brackets?

console.info("Like this?")

no like [ ]

This is a pretty cool project! This is a great way to learn about DOM traversals. Some cool features could be:

  1. A tab for easy copy and paste divs, like default square divs with a black border (which I use a lot for testing).
  2. Drop-down boxes for colors, or even text inputs to put in CSS color names (like powderblue, peru, etc).
  3. An option to “constrain proportions” (basically, keep it square) by making height and width the same.

Good luck!

Thanks! I will be trying to implement your suggestions soon,
But one question: What the frick is a DOM traversal? :laughing:

1 Like

I am working on an About Page

1 Like

I’ll be making a clone of this which would be a lot more optimized and such, that I won’t actually want you to use. It will be a small, simple demo like this.

*don’t tell me to merge the two designs please or do anything when I actually do make this since I want it to be “simple and small”

What? Uhh… ok

Ya. I do a lot of stuff for fun. And this will have the ability to control where it is.

So maybe just maybe it is something you could use

@no_one “DOM traversal” is just the general word for editing HTML elements through javascript. Loops, etc. Hope this makes sense!

Also @code-alt please do not use other platforms like twitter to insult other people. Most devs are still learning better ways to write code.


Attempt to delete tweet ^
https://archive.is/UNS01
7 Likes

I took it down for a short amount of time to make a better homepage design & to add other pages.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.