Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/abishekatp/stylers
/ functions
Functions
58 in github.com/abishekatp/stylers
⨍
Functions
58
◇
Types & classes
5
↓ 20 callers
Function
add_spaces
check if spaces needed to be appended note: this function also reset the pre_line and pre_col to the cureent token's end line and column note: this fu
stylers/src/style/utils.rs:52
↓ 6 callers
Function
build_style
This function will build the whole style text as rust TokenStream. This function will take two arguments. ts: TokenStream which is token stream of tex
stylers/src/style/mod.rs:23
↓ 4 callers
Method
css_text
This css_text method will give the whole at-rule as single string value. Note that we the calling function will be responsible for passing token strea
stylers/src/style/css_at_rule.rs:34
↓ 4 callers
Function
rand_class
()
stylers/src/lib.rs:114
↓ 3 callers
Function
parse_group
This parse_group function will parse the TokenTree::Group and return a string. This function will add at most one whitespace even if there are many wh
stylers/src/style/utils.rs:5
↓ 2 callers
Function
button_style
()
examples/style_modularized/src/lib.rs:44
↓ 2 callers
Function
get_component_name
first two tokens are for component name and comma. we extract those info in this function
stylers/src/lib.rs:157
↓ 2 callers
Function
parse_at_rule_declaration
Some at rules don't contain another style rule inside them for those rule we can directly parse the string
stylers/src/style_sheet/css_at_rule.rs:65
↓ 2 callers
Method
parse_selector
parse_selector method will parse the all parts of selector and add random class to them
stylers/src/style/css_style_rule.rs:88
↓ 2 callers
Function
run_tests
note: temporarily writing these tests. once find a way to test styler_core module we can discard this. run this command cargo run inside styler_test f
stylers_test/src/style_test.rs:6
↓ 2 callers
Function
write_to_file
append if file exists or write it into the new file
stylers/src/lib.rs:121
↓ 1 callers
Function
cat
(dir: &str)
stylers/src/lib.rs:136
↓ 1 callers
Function
levenshtein
levenshtein edit distance will give number inserterion or deletion or substitution needed to get string t from string s. ref: https://github.com/mbrla
stylers/src/style/css_style_declar.rs:463
↓ 1 callers
Function
min3
(a: usize, b: usize, c: usize)
stylers/src/style/css_style_declar.rs:492
↓ 1 callers
Method
parse
parse method will extract the selector part of the style-rule and parse that selector using parse_selector method.
stylers/src/style/css_style_rule.rs:37
↓ 1 callers
Method
parse
This parse method will parse the at-rule tokn stream. Note: this is recursive function it will handle nested at-rules.
stylers/src/style/css_at_rule.rs:60
↓ 1 callers
Method
parse
parse and validate the style declaration group and store it in style_css_text.
stylers/src/style/css_style_declar.rs:366
↓ 1 callers
Method
parse_from_str
This parse method will parse the at-rule block string. note: this is string version of the parse method in CSSAtRule struct.
stylers/src/style_sheet/css_at_rule.rs:20
↓ 1 callers
Method
parse_from_str
note: this is string version of the parse method in CSSStyleDeclaration struct.
stylers/src/style_sheet/css_style_declar.rs:14
↓ 1 callers
Function
parse_property_group
This parse_property_group function will parse the TokenTree::Group and return a string. This parse group will handle some property specific conitions.
stylers/src/style/css_style_declar.rs:499
↓ 1 callers
Method
parse_str
parse method will extract the selector part of the style-rule and parse that selector using parse_selector method.
stylers/src/style_sheet/css_style_rule.rs:18
↓ 1 callers
Method
style_css_text
style_css_text style declaration as text
stylers/src/style/css_style_declar.rs:361
↓ 1 callers
Function
validate_property
this function will check if property key exists or not. if not it will suggest the most relevent property.
stylers/src/style/css_style_declar.rs:441
Function
Abi
(cx: Scope)
examples/style/src/lib.rs:55
Function
Abi
(cx: Scope)
examples/style_sheet/src/lib.rs:21
Function
BlueButton
(cx: Scope)
examples/style_modularized/src/lib.rs:25
Function
BlueButton
(cx: Scope)
examples/style_sheet_str/src/lib.rs:5
Function
Child
(cx: Scope, class_name: String)
examples/style_parent_child/src/lib.rs:45
Function
GreenButton
(cx: Scope)
examples/style_str/src/lib.rs:5
Function
GreenButton
(cx: Scope)
examples/style_modularized/src/lib.rs:5
Function
Hello
(cx: Scope, name: &'static str)
examples/style/src/lib.rs:5
Function
Hello
(cx: Scope, name: &'static str)
examples/style_sheet/src/lib.rs:5
Function
Parent
(cx: Scope)
examples/style_parent_child/src/lib.rs:5
Function
build_style
This function will build the whole style text as the String. This build_style is string version of the build_style method from style macro.
stylers/src/style_sheet/mod.rs:10
Method
css_text
This css_text method will give the whole style-rule as single string value.
stylers/src/style/css_style_rule.rs:30
Method
empty
()
stylers/src/style/css_style_declar.rs:347
Method
from_str
This function will take the style block string and parse it. this function will only parse single stryle rule block
stylers/src/style_sheet/css_style_rule.rs:7
Method
from_str
This function will take the whole stylesheet content as string and return CSSStyleSheet structure
stylers/src/style_sheet/css_style_sheet.rs:7
Method
from_str
This method will parse the at-rule block string and return the CSSAtRule note: this is string version of the parse method in CSSAtRule struct.
stylers/src/style_sheet/css_at_rule.rs:8
Method
from_str
note: this is string version of the new method in CSSStyleDeclaration struct.
stylers/src/style_sheet/css_style_declar.rs:5
Function
main
()
stylers_test/src/main.rs:3
Function
main
()
examples/style_str/src/main.rs:4
Function
main
()
examples/style_modularized/src/main.rs:4
Function
main
()
examples/style/src/main.rs:4
Function
main
()
examples/style_sheet_str/src/main.rs:4
Function
main
()
examples/style_parent_child/src/main.rs:4
Function
main
()
examples/style_sheet/src/main.rs:4
Method
new
This function will take the token stream of one CSSStyleRule and parse it. Note that we the calling function will be responsible for passing token str
stylers/src/style/css_style_rule.rs:19
Method
new
This function will take the whole stylesheet content as token stream and return CSSStyleSheet structure
stylers/src/style/css_style_sheet.rs:25
Method
new
This method will parse the at-rule tokenstream and return teh CSSAtRule HashMap will contain all unique selectors which may be nested inside at-rule.
stylers/src/style/css_at_rule.rs:22
Method
new
new method parse the style declaration group
stylers/src/style/css_style_declar.rs:353
Function
run_tests
note: to check why test cases are failing we can use the text compare tools to compare and see the differences between left and right values of a test
stylers_test/src/style_sheet_test.rs:7
Function
style
(ts: TokenStream)
stylers/src/lib.rs:22
Function
style_sheet
(ts: TokenStream)
stylers/src/lib.rs:39
Function
style_sheet_str
(ts: TokenStream)
stylers/src/lib.rs:75
Function
style_sheet_test
(ts: TokenStream)
stylers/src/lib.rs:90
Function
style_str
(ts: TokenStream)
stylers/src/lib.rs:62
Function
style_test
(ts: TokenStream)
stylers/src/lib.rs:104