Skip to content

grqphical/ro-css

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

ro-css

A CSS Parser made for Roblox

How to Use

Either copy the source from ro-css.lua or add the toolbox model (https://www.roblox.com/library/12415105266/RoCSS) to your project. Then in a local script require the library and use this piece of code to parse any CSS code:

local module = require(MODULE_LOCATION)

module.ParseCSS(CSS_AS_STRING)

To apply the CSS to UI just add a string attribute called Class to whatever UI element you want (Make sure it's placed in StarterGUI) and ro-css should automatically apply the CSS to it. For example if you created a CSS block of:

.foobar {
  background-color: rgb(1,1,1);
}

ro-css will apply it to any element with the Class "foobar"

Here are the available properties:

{
		["anchor-point"] = "AnchorPoint",
		["background-color"] = "BackgroundColor3",
		["transparency"] = "BackgroundTransparency",
		["border-color"] = "BorderColor3",
		["border-size"] = "BorderSizePixel",
		["position"] = "Position",
		["rotation"] = "Rotation",
		["size"] = "Size",
		["z-index"] = "ZIndex",
		["text-color"] = "TextColor3",
		["text-size"] = "TextSize",
		["text-stroke-color"] = "TextStrokeColor3",
		["text-stroke-transparency"] = "TextStrokeTransparency",
		["text-transparency"] = "TextTransparency",
		["image-color"] = "ImageColor3",
		["image-offset"] = "ImageRectOffset",
		["image-size"] = "ImageRectSize",
		["placeholder-text-color"] = "PlaceholderColor3"
		
}

There are also functions that can be used for things like colour:

  • rgb(R,G,B) Creates a Color3 from an RGB value
  • hsv(H,S,V) Creates a Color3 from an HSV value
  • udim(POS, OFFSET) Creates a UDIM
  • udim2(XPOS, XOFFSET, YPOS, YOFFSET) Creates a udim2

Notes

MAKE SURE TO ADD SEMICOLONS TO THE END OF EVERY LINE ELSE IT WILL NOT PARSE CORRECTLY

About

A CSS Parser made for Roblox

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages